RMIFactory rmiFactory = (RMIFactory)Class.forName( (String)lookup("java:comp/env/RMIFactory", java.lang.String.class) ).newInstance(); rmiFactory.startConnection( args );
String className = getLocator().getString("java:comp/env/RMIFactory"); RMIFactory rmiFactory = (RMIFactory) Class.forName(className).newInstance(); rmiFactory.startConnection(args);
    public void startExternalService( String[] args ) {        debug(">startService()");        try {            RMIFactory rmiFactory = (RMIFactory)Class.forName(                (String)lookup("java:comp/env/RMIFactory",                               java.lang.String.class)                ).newInstance();            rmiFactory.startConnection( args );            debug(">startService()");        } catch( Exception e ) {            error("Error starting external service.", e);            throw new EJBException("Error starting external service", e);        }    } // startExternalService