@Override protected void onInitialize( ClientServiceManager s ) { rpc = getService(RpcClientService.class); if( rpc == null ) { throw new RuntimeException("RmiClientService requires RpcClientService"); } // Register it now so that it is available when the // server starts to send us stuff. Waiting until start() // is too late in this case. rmi = new RmiRegistry(rpc.getRpcConnection(), rmiObjectId, defaultChannel); }
/** * Sets up RMI hosting services for the hosted connection allowing * getRmiRegistry() to return a valid RmiRegistry object. * This method is called automatically for all new connections if * autohost is set to true. */ public void startHostingOnConnection( HostedConnection hc ) { if( log.isLoggable(Level.FINEST) ) { log.log(Level.FINEST, "startHostingOnConnection:{0}", hc); } RmiRegistry rmi = new RmiRegistry(hc, rpcService.getRpcConnection(hc), rmiId, defaultChannel); hc.setAttribute(ATTRIBUTE_NAME, rmi); // Register any global shares for( Map.Entry<String, GlobalShare> e : globalShares.entrySet() ) { GlobalShare share = e.getValue(); rmi.share(share.channel, e.getKey(), share.object, share.type); } }
@Override protected void onInitialize( ClientServiceManager s ) { rpc = getService(RpcClientService.class); if( rpc == null ) { throw new RuntimeException("RmiClientService requires RpcClientService"); } // Register it now so that it is available when the // server starts to send us stuff. Waiting until start() // is too late in this case. rmi = new RmiRegistry(rpc.getRpcConnection(), rmiObjectId, defaultChannel); }
/** * Sets up RMI hosting services for the hosted connection allowing * getRmiRegistry() to return a valid RmiRegistry object. * This method is called automatically for all new connections if * autohost is set to true. */ public void startHostingOnConnection( HostedConnection hc ) { if( log.isLoggable(Level.FINEST) ) { log.log(Level.FINEST, "startHostingOnConnection:{0}", hc); } RmiRegistry rmi = new RmiRegistry(hc, rpcService.getRpcConnection(hc), rmiId, defaultChannel); hc.setAttribute(ATTRIBUTE_NAME, rmi); // Register any global shares for( Map.Entry<String, GlobalShare> e : globalShares.entrySet() ) { GlobalShare share = e.getValue(); rmi.share(share.channel, e.getKey(), share.object, share.type); } }