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

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

Best Java code snippets using com.jme3.network.service.rmi.RmiRegistry.share (Showing top 17 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

/**
 *  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

/**
 *  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

/**
 *  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

@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: jMonkeyEngine/jmonkeyengine

/**
 *  Shares the specified object with the server and associates it with the 
 *  specified name.  Objects shared in this way are available in the connection-specific
 *  RMI registry on the server and are not available to other connections.
 *  All object related communication will be done over the specified connection
 *  channel.
 */
public <T> void share( byte channel, String name, T object, Class<? super T> type ) {
  if( !isStarted ) {
    synchronized(pending) {
      if( !isStarted ) {
        pending.add(new ObjectInfo(channel, name, object, type));
        return;
      }
    }   
  }
  
  // Else we can add it directly.
  rmi.share(channel, name, 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

/**
 *  Shares a server-wide object associated with the specified name over the specified
 *  channel.  All connections with RMI hosting started will have access to this shared 
 *  object as soon as they connect and they will all share the same instance.  It is up 
 *  to the shared object to handle any multithreading that might be required.
 *  All network communcation associated with the shared object will be done over
 *  the specified channel. 
 */     
public <T> void shareGlobal( byte channel, String name, T object, Class<? super T> type ) {
  GlobalShare share = new GlobalShare(channel, object, type);
  GlobalShare existing = globalShares.put(name, share);
  if( existing != null ) {
    // Shouldn't need to do anything actually.
  }
  
  // Go through all of the children
  for( HostedConnection conn : getServer().getConnections() ) {
    RmiRegistry child = getRmiRegistry(conn);
    if( child == null ) {
      continue;
    }
    child.share(channel, name, object, type);
  }
} 
origin: org.jmonkeyengine/jme3-networking

/**
 *  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: org.jmonkeyengine/jme3-networking

/**
 *  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: org.jmonkeyengine/jme3-networking

/**
 *  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: org.jmonkeyengine/jme3-networking

@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

/**
 *  Shares the specified object with the server and associates it with the 
 *  specified name.  Objects shared in this way are available in the connection-specific
 *  RMI registry on the server and are not available to other connections.
 *  All object related communication will be done over the specified connection
 *  channel.
 */
public <T> void share( byte channel, String name, T object, Class<? super T> type ) {
  if( !isStarted ) {
    synchronized(pending) {
      if( !isStarted ) {
        pending.add(new ObjectInfo(channel, name, object, type));
        return;
      }
    }   
  }
  
  // Else we can add it directly.
  rmi.share(channel, name, object, 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: tonihele/OpenKeeper

@Override
public void startHostingOnConnection(HostedConnection conn) {
  logger.log(Level.FINER, "startHostingOnConnection({0})", conn);
  AccountSessionImpl session = new AccountSessionImpl(conn);
  conn.setAttribute(ATTRIBUTE_SESSION, session);
  // Expose the session as an RMI resource to the client
  RmiRegistry rmi = rmiService.getRmiRegistry(conn);
  rmi.share(NetworkConstants.LOBBY_CHANNEL, session, AccountSession.class);
}
origin: org.jmonkeyengine/jme3-networking

/**
 *  Shares a server-wide object associated with the specified name over the specified
 *  channel.  All connections with RMI hosting started will have access to this shared 
 *  object as soon as they connect and they will all share the same instance.  It is up 
 *  to the shared object to handle any multithreading that might be required.
 *  All network communcation associated with the shared object will be done over
 *  the specified channel. 
 */     
public <T> void shareGlobal( byte channel, String name, T object, Class<? super T> type ) {
  GlobalShare share = new GlobalShare(channel, object, type);
  GlobalShare existing = globalShares.put(name, share);
  if( existing != null ) {
    // Shouldn't need to do anything actually.
  }
  
  // Go through all of the children
  for( HostedConnection conn : getServer().getConnections() ) {
    RmiRegistry child = getRmiRegistry(conn);
    if( child == null ) {
      continue;
    }
    child.share(channel, name, object, type);
  }
} 
origin: tonihele/OpenKeeper

/**
 * Starts hosting the chat services on the specified connection using a
 * specified player name. This causes the player to 'enter' the chat room
 * and will then be able to send/receive messages.
 */
public void startHostingOnConnection(HostedConnection conn, String playerName) {
  logger.log(Level.FINER, "startHostingOnConnection({0})", conn);
  ChatSessionImpl session = new ChatSessionImpl(conn, playerName);
  conn.setAttribute(ATTRIBUTE_SESSION, session);
  // Expose the session as an RMI resource to the client
  RmiRegistry rmi = rmiService.getRmiRegistry(conn);
  rmi.share(NetworkConstants.CHAT_CHANNEL, session, ChatSession.class);
  players.add(session);
  // Send the enter event to other players
  for (ChatSessionImpl chatter : players) {
    if (chatter == session) {
      // Don't send our enter event to ourselves
      continue;
    }
    chatter.playerJoined(conn.getId(), playerName);
  }
}
origin: tonihele/OpenKeeper

rmi.share(NetworkConstants.LOBBY_CHANNEL, session, LobbySession.class);
com.jme3.network.service.rmiRmiRegistryshare

Javadoc

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.

Popular methods of RmiRegistry

  • getRemoteObject
    Looks up a remote object by name and returns a local proxy to the remote object that was shared on t
  • <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