Codota Logo
RmiRegistry
Code IndexAdd Codota to your IDE (free)

How to use
RmiRegistry
in
com.jme3.network.service.rmi

Best Java code snippets using com.jme3.network.service.rmi.RmiRegistry (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
ArrayList a =
  • Codota Iconnew ArrayList<String>()
  • Codota Iconnew ArrayList()
  • Codota Iconnew ArrayList<Object>()
  • Smart code suggestions by Codota
}
origin: jMonkeyEngine/jmonkeyengine

/**
 *  Looks up a remote object on the server by type and returns a local proxy to the 
 *  remote object that was shared on the other end of the network connection.  
 */
public <T> T getRemoteObject( Class<T> type ) {
  return rmi.getRemoteObject(type);
}
   
origin: jMonkeyEngine/jmonkeyengine

/**
 *  Exposes the specified object to the other end of the connection as
 *  the specified interface type.  The object can be looked up by type
 *  on the other end.
 */
public <T> void share( T object, Class<? super T> type ) {
  share(defaultChannel, object, type);       
}
 
origin: jMonkeyEngine/jmonkeyengine

/**
 *  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); 
  }
}
origin: jMonkeyEngine/jmonkeyengine

  @Override
  public Object call( RpcConnection conn, short objectId, short procId, Object... args ) {
    if( objectId == rmiId ) {
      rmiUpdate(procId, args);
      return null;
    } else {
      return invokeLocal(objectId, procId, args);
    }
  }
}
origin: jMonkeyEngine/jmonkeyengine

/**
 *  Handle remote object registry updates from the other end.
 */
protected void rmiUpdate( short procId, Object[] args ) {
  if( log.isLoggable(Level.FINEST) ) {
    log.finest("rmiUpdate(" + procId + ", " + Arrays.asList(args) + ")");
  }
  switch( procId ) {
    case NEW_CLASS:
      addRemoteClass((ClassInfo)args[0]);
      break; 
    case REMOVE_OBJECT:
      removeRemoteObject((Short)args[0]);
      break;
    case ADD_OBJECT:
      ClassInfo info = remote.classes.get((Short)args[3]);
      addRemoteObject((Byte)args[0], (Short)args[1], (String)args[2], info);
      break;
  }
}
origin: jMonkeyEngine/jmonkeyengine

@Override
public Object invoke(Object o, Method method, Object[] os) throws Throwable {
  MethodInfo mi = getMethodInfo(method);
  if( mi == null ) {
    // Try to invoke locally
    return method.invoke(this, os);
  }
  return rmi.invokeRemote(channel, objectId, mi.getId(), mi.getCallType(), os);
}
origin: jMonkeyEngine/jmonkeyengine

/**
 *  Returns a local object that was previously registered with share() using
 *  just type registration.
 */
public <T> T getLocalObject( Class<T> type ) {
  return getLocalObject(type.getName(), type);
}
 
origin: jMonkeyEngine/jmonkeyengine

@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);        
}
 
origin: org.jmonkeyengine/jme3-networking

/**
 *  Handle remote object registry updates from the other end.
 */
protected void rmiUpdate( short procId, Object[] args ) {
  if( log.isLoggable(Level.FINEST) ) {
    log.finest("rmiUpdate(" + procId + ", " + Arrays.asList(args) + ")");
  }
  switch( procId ) {
    case NEW_CLASS:
      addRemoteClass((ClassInfo)args[0]);
      break; 
    case REMOVE_OBJECT:
      removeRemoteObject((Short)args[0]);
      break;
    case ADD_OBJECT:
      ClassInfo info = remote.classes.get((Short)args[3]);
      addRemoteObject((Byte)args[0], (Short)args[1], (String)args[2], info);
      break;
  }
}
origin: org.jmonkeyengine/jme3-networking

  @Override
  public Object call( RpcConnection conn, short objectId, short procId, Object... args ) {
    if( objectId == rmiId ) {
      rmiUpdate(procId, args);
      return null;
    } else {
      return invokeLocal(objectId, procId, args);
    }
  }
}
origin: org.jmonkeyengine/jme3-networking

@Override
public Object invoke(Object o, Method method, Object[] os) throws Throwable {
  MethodInfo mi = getMethodInfo(method);
  if( mi == null ) {
    // Try to invoke locally
    return method.invoke(this, os);
  }
  return rmi.invokeRemote(channel, objectId, mi.getId(), mi.getCallType(), os);
}
origin: org.jmonkeyengine/jme3-networking

/**
 *  Returns a local object that was previously registered with share() using
 *  just type registration.
 */
public <T> T getLocalObject( Class<T> type ) {
  return getLocalObject(type.getName(), type);
}
 
origin: org.jmonkeyengine/jme3-networking

@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);        
}
 
origin: jMonkeyEngine/jmonkeyengine

/**
 *  Exposes the specified object to the other end of the connection as
 *  the specified interface type and associates it with the specified name.  
 *  The object can be looked up by the associated name on the other end of
 *  the connection.
 */
public <T> void share( String name, T object, Class<? super T> type ) {
  share(defaultChannel, name, object, type);
}
 
origin: jMonkeyEngine/jmonkeyengine

/**
 *  Looks up a remote object on the server by name and returns a local proxy to the 
 *  remote object that was shared on the other end of the network connection.  
 */
public <T> T getRemoteObject( String name, Class<T> type ) {
  return rmi.getRemoteObject(name, type);
}    
origin: org.jmonkeyengine/jme3-networking

/**
 *  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); 
  }
}
origin: jMonkeyEngine/jmonkeyengine

/**
 *  Exposes, through a specific connection channel, the specified object 
 *  to the other end of the connection as the specified interface type.  
 *  The object can be looked up by type on the other end.
 *  The specified channel will be used for all network communication
 *  specific to this object. 
 */
public <T> void share( byte channel, T object, Class<? super T> type ) {
  share(channel, type.getName(), object, type);
} 
 
origin: jMonkeyEngine/jmonkeyengine

/**
 *  Looks up a remote object by type and returns a local proxy to the remote object 
 *  that was shared on the other end of the network connection.  If this is called 
 *  from a client then it is accessing a shared object registered on the server.  
 *  If this is called from the server then it is accessing a shared object registered 
 *  on the client.
 */
public <T> T getRemoteObject( Class<T> type ) {
  return getRemoteObject(type.getName(), type);
}
origin: jMonkeyEngine/jmonkeyengine

@Override
public void start() {
  super.start();
  
  // Register all of the classes that have been waiting.
  synchronized(pending) {
    for( ObjectInfo info : pending ) {
      rmi.share(info.channel, info.name, info.object, info.type);
    }
    pending.clear();
    isStarted = true;
  }
}
 
origin: org.jmonkeyengine/jme3-networking

/**
 *  Looks up a remote object on the server by name and returns a local proxy to the 
 *  remote object that was shared on the other end of the network connection.  
 */
public <T> T getRemoteObject( String name, Class<T> type ) {
  return rmi.getRemoteObject(name, type);
}    
com.jme3.network.service.rmiRmiRegistry

Most used methods

  • getRemoteObject
    Looks up a remote object by name and returns a local proxy to the remote object that was shared on t
  • share
    Exposes the specified object to the other end of the connection as the specified interface type and
  • <init>
  • addRemoteClass
  • addRemoteObject
  • getLocalObject
    Returns a local object that was previously registered with share() using name registration.
  • invokeLocal
    Handle the actual remote object method calls.
  • invokeRemote
  • removeRemoteObject
  • rmiUpdate
    Handle remote object registry updates from the other end.

Popular in Java

  • Finding current android device location
  • compareTo (BigDecimal)
  • runOnUiThread (Activity)
  • findViewById (Activity)
  • Permission (java.security)
    Abstract class for representing access to a system resource. All permissions have a name (whose inte
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • Locale (java.util)
    A Locale object represents a specific geographical, political, or cultural region. An operation that
  • Properties (java.util)
    The Properties class represents a persistent set of properties. The Properties can be saved to a st
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now