textbender.a.r.desk
Class HostServiceRegistry1

java.lang.Object
  extended by java.rmi.server.RemoteObject
      extended by java.rmi.server.RemoteServer
          extended by java.rmi.server.UnicastRemoteObject
              extended by HostServiceRegistry1
All Implemented Interfaces:
Serializable, Remote, HostServiceRegistry

@ThreadSafe
public final class HostServiceRegistry1
extends UnicastRemoteObject
implements HostServiceRegistry

Service registry implementation. The single instance of HostServiceRegistry1 is available via HostServiceRegistry1.i().

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface HostServiceRegistry
HostServiceRegistry.UniqueID, HostServiceRegistry.X
 
Field Summary
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
HostServiceRegistry1()
          Creates the single instance of HostServiceRegistry1; makes it available via i(); and binds it in the RMI boot-registry.
 
Method Summary
<S extends Remote>
void
addService(Class<S> serviceInterface, S serviceInstance)
          Adds a new service to the registry.
 File allInOneJar()
          Returns the file path of an all-in-one textbender JAR, suitable as a codebase for applets and applications.
<S extends Remote>
S
getService(Class<S> serviceInterface)
          Returns an instance of the specified service.
static HostServiceRegistry1 i()
          The single instance of HostServiceRegistry1, or null if there is none.
 HostServiceRegistry.UniqueID nextUniqueID()
          Returns the next unique identifier.
 URL resolveJarURL()
          Deprecated. 
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HostServiceRegistry1

HostServiceRegistry1()
               throws NotBoundException,
                      RemoteException
Creates the single instance of HostServiceRegistry1; makes it available via i(); and binds it in the RMI boot-registry.

Throws:
NotBoundException - if an RMI exception prevents binding
RemoteException - if the instance cannot be created or bound
Method Detail

i

public static HostServiceRegistry1 i()
The single instance of HostServiceRegistry1, or null if there is none.

Returns:
instance, or null if none was created

addService

public <S extends Remote> void addService(Class<S> serviceInterface,
                                          S serviceInstance)
Adds a new service to the registry. Once added, the service cannot be removed.

Parameters:
serviceInterface - per getService()
serviceInstance - that actually implements the interface
Throws:
IllegalStateException - if a service was already added for that serviceInterface

allInOneJar

public File allInOneJar()
                 throws IOException
Description copied from interface: HostServiceRegistry
Returns the file path of an all-in-one textbender JAR, suitable as a codebase for applets and applications. This JAR is intended for use by boot applets that would otherwise lack a local codebase, and is available only in demo installations of the desk daemon (in normal installations, demo texts ought to boot like any other, with no need of this facility).

Specified by:
allInOneJar in interface HostServiceRegistry
Throws:
IOException - if the JAR is unavailable, or the JAR file cannot be created
See Also:
BootApplet

getService

public <S extends Remote> S getService(Class<S> serviceInterface)
                            throws AccessException,
                                   UnknownHostException
Description copied from interface: HostServiceRegistry
Returns an instance of the specified service.

Specified by:
getService in interface HostServiceRegistry
Parameters:
serviceInterface - specifying the service
Throws:
AccessException - if the caller is from another host. Services are provided only to the local host.
UnknownHostException

nextUniqueID

public HostServiceRegistry.UniqueID nextUniqueID()
Description copied from interface: HostServiceRegistry
Returns the next unique identifier.

Specified by:
nextUniqueID in interface HostServiceRegistry

resolveJarURL

@Deprecated
public URL resolveJarURL()
                  throws IOException
Deprecated. 

Description copied from interface: HostServiceRegistry
Resolves and returns the URL of the desk daemon's runtime JAR.

Specified by:
resolveJarURL in interface HostServiceRegistry
Throws:
IOException
See Also:
HostServiceRegistry.allInOneJar()