users@glassfish.java.net

migrating off weblogic, getting ejb2 remote bean interface

From: <glassfish_at_javadesktop.org>
Date: Tue, 14 Oct 2008 08:43:01 PDT

We are starting to migrate our platform off of weblogic 8. We are currently looking at glassfish and jboss. However, I inherited a class (below) that is used by a couple of remote applications calling an old ejb.

How do I do the below for glassfish (or jboss)?

Thanks,
Daniel


// this class sets context properties and gets the remote interface to DOL
// URL is either the local host or cluster address

public class DBDOLConnect { // lookup the remote interface

  static public DOLDirector dolDirectorConnection(String URL) throws NamingException, RemoteException, CreateException {
    Context ctx = makeContext(URL);
    DOLDirectorHome home = (DOLDirectorHome) PortableRemoteObject.narrow(ctx.lookup("DOLDirectorHome"),
        DOLDirectorHome.class);
    DOLDirector remote = home.create();
    return remote;
  } // end edcConnection

  static private Context makeContext(String URL) throws NamingException { // set some properties
    Properties props = new Properties();
    props.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
    props.put(Context.PROVIDER_URL, "t3://" + URL);
    return new InitialContext(props);
  } // end makeContext
} // EndClass
[Message sent by forum member 'dcartee4' (dcartee4)]

http://forums.java.net/jive/thread.jspa?messageID=306798