Java核心代码例程之:RMIExampleSetup.java
2008-01-05 08:38:23 来源:WEB开发网核心提示:import java.rmi.*;import javax.naming.*;/** * This class registers RMIExampleServer with the RMI registry * @author Renga **/public class RMIExampleSetup {/** *
import java.rmi.*;
import javax.naming.*;
/**
* This class registers RMIExampleServer with the RMI registry
* @author Renga
**/
public class RMIExampleSetup {
/**
* Main method
* @param args Command-line arguments
**/
public static void main( String[] args ) {
try {
// Set the security manager
System.setSecurityManager( new RMISecurityManager() );
// Create a new object of RMIExampleServer
RMIExampleServer server = new RMIExampleServer();
// Bind this object with the RMI registry
Naming.bind( "RMIExample", server );
} catch( Exception e ) {
e.PRintStackTrace();
}
}
}
更多精彩
赞助商链接