|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.sapia.regis.remote.RegistryExporter
public class RegistryExporter
An instance of this class exports a Registry as
a remote object.
The Registry that his held by an instance of this
class will internally be made available through the network upon
one of the bind() methods being called.
To lookup a Registry that has been bound by an
instance of this class, applications can use a RegistryImporter,
or a RemoteRegistryFactory.
bind(int),
bind(String, Properties),
RegistryImporter,
RemoteRegistryFactory| Field Summary | |
|---|---|
static String |
DISCO
|
static String |
PUBLISH
|
| Fields inherited from interface org.sapia.regis.remote.RemoteConsts |
|---|
BOOTSTRAP, DEBUG, DEFAULT_PASSWORD, DEFAULT_USERNAME, PASSWORD, PEER_TO_PEER, SERVER_JNDI_NAME, SERVER_PORT, USERNAME |
| Constructor Summary | |
|---|---|
RegistryExporter(Registry reg,
Properties bootstrapProps)
|
|
RegistryExporter(String username,
String password,
Registry reg,
Properties bootstrapProps)
|
|
| Method Summary | |
|---|---|
void |
bind(int port)
This method bind the Registry held by this
instance on the network, on the given port. |
void |
bind(String jndiName,
Properties props)
This method binds the Registry held by this
instance to the JNDI service that corresponds to the given properties, under
the given JNDI name. |
void |
close()
Closes this instance (which releases all system resources it holds). |
void |
onAsyncEvent(org.sapia.ubik.mcast.RemoteEvent evt)
|
void |
setDomain(String domain)
|
void |
setPeerToPeer(boolean peerToPeer)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String PUBLISH
public static final String DISCO
| Constructor Detail |
|---|
public RegistryExporter(Registry reg,
Properties bootstrapProps)
public RegistryExporter(String username,
String password,
Registry reg,
Properties bootstrapProps)
| Method Detail |
|---|
public void setPeerToPeer(boolean peerToPeer)
peerToPeer - indicates if this instance should behave as peer in a network of registries
- by default, this instance is not in peer-to-peer mode.public void setDomain(String domain)
domain - the name of the domain to which this instance belongs.public void close()
public void bind(int port)
throws Exception
Registry held by this
instance on the network, on the given port. The registry thus
becomes available as a remote object.
Clients can connect to the registry through the Ubik Hub:
// connects on the given host, port
Registry reg = (Registry)Hub.connect("192.168.0.101", 40000);
Note that Ubik runtime attempts to bind servers on addresses that match the
value of the ubik.rmi.address-pattern system property. If that
property is not defined, then the address used will be the first that DOES NOT
correspond to "localhost" or 127.0.0.1. If no such address exists, then "localhost"
is internally used.
If "localhost" must be used (for testing purposes for example), then the
ubik.rmi.address-pattern system property should be set, with
localhost as a value.
port - a port
Exception - if the registry could not be exported
public void bind(String jndiName,
Properties props)
throws Exception
Registry held by this
instance to the JNDI service that corresponds to the given properties, under
the given JNDI name.
The properties passed in correspond to the ones expected by Ubik's JNDI provider (see the tutorial)
ubik://localhost:1099).
Client applications can lookup a registry exported by this instance using a RegistryImporter,
or a RemoteRegistryFactory.
For more info concerning the properties defined above, see the javadoc for the Const class.
jndiName - the JNDI name under which the registry should be
bound in the Ubik JNDI service.props - must hold Ubik JNDI properties
Exception - if the registry could not be bound to the JNDI service.RegistryImporterpublic void onAsyncEvent(org.sapia.ubik.mcast.RemoteEvent evt)
onAsyncEvent in interface org.sapia.ubik.mcast.AsyncEventListener
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||