startup.java

来自「EJB3.0请一定要上载质量高而且本站没有的源码」· Java 代码 · 共 33 行

JAVA
33
字号
package examples.jndi;
import javax.naming.*;

/**
 * A helper class which starts our RMI-IIOP server
 */
public class Startup { 

     /**
      * Our main() method starts things up
      */
     public static void main(String args[]) throws Exception { 

          /*
           * Start up our PKGenerator remote object.  It will
           * automatically export itself.
           */
          PrimaryKeyGenerator generator = new PrimaryKeyGeneratorImpl();

          /*
           * Bind our PKGenerator remote object to the JNDI tree
           */
          Context ctx = new InitialContext(System.getProperties());
          ctx.rebind("PKGenerator", generator);
          System.out.println("PKGenerator bound to JNDI tree.");

          // wait for clients
          synchronized (generator) { 
            generator.wait();
          } 
     } 
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?