|
From: Leif M. <le...@ta...> - 2005-04-14 05:22:50
|
Stacey,
The Wrapper user list is a better place for these questions. :-)
The Wrapper only supports the execution of a single JVM per
Wrapper instance. If you want to have both an app and an rmiregistry
then you would need to either use two JVM/Wrappers or create the
rmiregistry instance from within your application.
The second is not as hard as it sounds. This is from an application
that I have which does the same. First you need to set a
security manager:
if ( System.getSecurityManager() == null )
{
System.setSecurityManager( new RMISecurityManager() );
}
There is a lot of unrelated code in my program that you probably
don't need, but I think the guts of what you want are the following:
m_registry = LocateRegistry.createRegistry( m_port,
m_rmiSocketFactory, m_rmiSocketFactory );
getLogger().debug( " RMI registry created." );
// Now that we have a registry, bind the RemoteBackboneServer instance.
getLogger().debug( "Binding master server instance..." );
m_registry.rebind( MASTER_NAME, m_remoteServer );
Variable description. m_port is the RMI port to use. m_rmiSocketFactory is
a custom RMISocketFactory implementation that lets me handle socket
timeouts.
m_remoteServer is a UnicastRemoteObject subclass instance that represents
the application to the RMI world.
Cheers,
Leif
Stacey Acosta wrote:
> Hello Leif,
> Short of creating two services (one for the app and one for
> rmiregistry), does JSW support rmi? I haven't found any documentation
> on the site nor have I seen any information about it in either the
> user or support mailing lists.
> If it does and there is some documentation, could you point me to it?
> Thanks,
> sra
|