|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.eodisp.remote.application.RemoteAppModule
public class RemoteAppModule
An application module implementation that configures, starts up and shuts
down the network infrastructure of a Java application. So far, it supports
TCP and JXTA transport. The JXTA transport is specifically configured for
EODiSP applications (see newDefaultJxtaConfiguration()).
| Field Summary | |
|---|---|
static java.lang.String |
ID
The Id of this Application Module. |
(package private) static org.apache.log4j.Logger |
logger
Log4J logger for this class |
| Constructor Summary | |
|---|---|
RemoteAppModule(int defaultTcpListeningPort)
|
|
| Method Summary | |
|---|---|
java.rmi.Remote |
export(java.rmi.Remote objectToExport)
Exports the given remote object on all transports defined in the configuration (so far JXTA and/or TCP). |
java.rmi.Remote |
export(java.rmi.Remote objectToExport,
RemoteConfiguration.TransportType transportType)
Exports the given remote object on all transports defined in the configuration (so far JXTA and/or TCP). |
java.rmi.Remote |
exportAndRegister(java.rmi.Remote objectToExport,
java.lang.String registryKey)
Exports the given remote object on all transports defined in the configuration (so far JXTA and/or TCP). |
java.util.Map<RemoteConfiguration.TransportType,java.net.URI> |
getEndpointUris()
|
RemoteConfiguration.TransportType |
getFavoriteTransport()
|
java.lang.String |
getId()
|
JxtaNetworkManager |
getJxtaNetworkManager()
|
java.net.URI |
getLocalUri(RemoteConfiguration.TransportType transportType)
|
JeriRegistry |
getRegistry()
Returns the (single) registry on which remote objects can be registered for this application. |
JeriRegistry |
getRegistry(RemoteConfiguration.TransportType transportType)
Returns the (single) registry on which remote objects can be registered for this application. |
JeriRegistry |
getRegistry(java.net.URI uri)
Returns the registry of the JVM at the given location. |
java.util.Map<RemoteConfiguration.TransportType,JeriRegistry> |
getRegistryProxies()
|
protected NetworkConfigurator |
newDefaultJxtaConfiguration()
Returns a pre-configured JXTA network configurator that is suitable for most EODiSP applications that do not act as a rendezvous or relay. |
void |
postShutdown(org.eodisp.util.RootApp rootApp)
|
void |
preStartup(org.eodisp.util.RootApp rootApp)
|
void |
registerConfiguration(org.eodisp.util.RootApp rootApp)
|
void |
shutdown(org.eodisp.util.RootApp rootApp)
|
void |
startup(org.eodisp.util.RootApp rootApp)
|
boolean |
unexport(java.rmi.Remote objectToUnexport,
RemoteConfiguration.TransportType transportType,
boolean force)
|
boolean |
unexportAll(java.rmi.Remote objectToUnexport,
boolean force)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String ID
static org.apache.log4j.Logger logger
| Constructor Detail |
|---|
public RemoteAppModule(int defaultTcpListeningPort)
| Method Detail |
|---|
public java.lang.String getId()
getId in interface org.eodisp.util.AppModule
public void registerConfiguration(org.eodisp.util.RootApp rootApp)
throws java.lang.Exception
registerConfiguration in interface org.eodisp.util.AppModulejava.lang.Exception
public void preStartup(org.eodisp.util.RootApp rootApp)
throws java.lang.Exception
Sets JXTA logger to only log ERROR message unless set
otherwise before
preStartup in interface org.eodisp.util.AppModulejava.lang.Exception
public void startup(org.eodisp.util.RootApp rootApp)
throws net.jxta.exception.PeerGroupException,
java.io.IOException,
org.eodisp.util.configuration.ConfigurationException
startup in interface org.eodisp.util.AppModulenet.jxta.exception.PeerGroupException
java.io.IOException
org.eodisp.util.configuration.ConfigurationExceptionprotected NetworkConfigurator newDefaultJxtaConfiguration()
NetworkConfigurator.newNetworkConfiguratorEdge()):
The relay and rendezvous seeds are configured as follows:
tcp://rdv.eodisp.org:14301http://rdv.eodisp.org:80tcp://rdv.eodisp.org:14301http://rdv.eodisp.org:80The tcp configuration is changed as follows:
| Tcp Port | 0 |
|---|---|
| Tcp Start Port | -1 (Disables port range feature) |
| Tcp End Port | -1 (Disables port range feature) |
Note that the returned configurator can not be readily used. At least the name and description should be set before using it.
public RemoteConfiguration.TransportType getFavoriteTransport()
public void postShutdown(org.eodisp.util.RootApp rootApp)
throws java.lang.Exception
postShutdown in interface org.eodisp.util.AppModulejava.lang.Exception
public void shutdown(org.eodisp.util.RootApp rootApp)
throws java.lang.Exception
shutdown in interface org.eodisp.util.AppModulejava.lang.Exception
public boolean unexport(java.rmi.Remote objectToUnexport,
RemoteConfiguration.TransportType transportType,
boolean force)
objectToUnexport - the object that shall be unexportedforce - if true, the remote object will be unexported
even if there are remote calls pending or in progress; if
false, the remote object may only be
unexported if there are no known remote calls pending or in
progress
true if the remote object is unexported when this
method returns and false otherwise
java.lang.IllegalStateException - if an object has not been exported with this
Exporter instance
public boolean unexportAll(java.rmi.Remote objectToUnexport,
boolean force)
public java.rmi.Remote export(java.rmi.Remote objectToExport)
remote - the remote object to export
null
if export failed for all transports.
public java.rmi.Remote export(java.rmi.Remote objectToExport,
RemoteConfiguration.TransportType transportType)
objectToExport - the remote object to exporttransportType - the transport that shall be used for the returned proxy
transportType
public java.rmi.Remote exportAndRegister(java.rmi.Remote objectToExport,
java.lang.String registryKey)
remote - the remote object to export
null
if export failed for all transports.
java.rmi.RemoteExceptionpublic JeriRegistry getRegistry()
public java.util.Map<RemoteConfiguration.TransportType,JeriRegistry> getRegistryProxies()
public JeriRegistry getRegistry(RemoteConfiguration.TransportType transportType)
public JeriRegistry getRegistry(java.net.URI uri)
throws java.net.URISyntaxException
RemoteConfiguration#getJeriConnecionTimeout().
uri - the URI where registry is exported. E.g:
tcp://examplehost.org:7900.
java.net.URISyntaxException - Thrown if any of the following is true:
tcp and urn:jxtaIDFactory.fromURI(java.net.URI)public java.net.URI getLocalUri(RemoteConfiguration.TransportType transportType)
public java.util.Map<RemoteConfiguration.TransportType,java.net.URI> getEndpointUris()
public JxtaNetworkManager getJxtaNetworkManager()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||