User: fleury
Date: 00/08/08 14:17:58
Added: src/main/org/jboss/ejb/plugins/jrmp/interfaces
HomeHandleImpl.java StatefulHandleImpl.java
Log:
The two new handle, the home handle (incomplete) and the StatefulHandle
Revision Changes Path
1.1
jboss/src/main/org/jboss/ejb/plugins/jrmp/interfaces/HomeHandleImpl.java
Index: HomeHandleImpl.java
===================================================================
/*
* jBoss, the OpenSource EJB server
*
* Distributable under GPL license.
* See terms of license at gnu.org.
*/
package org.jboss.ejb.plugins.jrmp.interfaces;
import java.rmi.RemoteException;
import java.rmi.ServerException;
import javax.ejb.HomeHandle;
import javax.ejb.EJBHome;
import javax.naming.InitialContext;
import java.lang.reflect.Method;
/**
* <description>
*
* @see <related>
* @author Rickard �berg ([EMAIL PROTECTED])
* @version $Revision: 1.1 $
*/
public class HomeHandleImpl
implements HomeHandle
{
// Constants -----------------------------------------------------
// Attributes ----------------------------------------------------
String name;
// Static --------------------------------------------------------
// Constructors --------------------------------------------------
public HomeHandleImpl(String name)
{
this.name = name;
}
// Public --------------------------------------------------------
// Handle implementation -----------------------------------------
public EJBHome getEJBHome()
throws RemoteException
{
try
{
return (EJBHome) new InitialContext().lookup(name);
} catch (Exception e)
{
throw new ServerException("Could not get EJBHome", e);
}
}
// Package protected ---------------------------------------------
// Protected -----------------------------------------------------
// Private -------------------------------------------------------
// Inner classes -------------------------------------------------
}
1.1
jboss/src/main/org/jboss/ejb/plugins/jrmp/interfaces/StatefulHandleImpl.java
Index: StatefulHandleImpl.java
===================================================================
/*
* jBoss, the OpenSource EJB server
*
* Distributable under GPL license.
* See terms of license at gnu.org.
*/
package org.jboss.ejb.plugins.jrmp.interfaces;
import java.rmi.RemoteException;
import java.rmi.ServerException;
import javax.ejb.Handle;
import javax.ejb.EJBObject;
import javax.naming.InitialContext;
import java.lang.reflect.Method;
import org.jboss.logging.Logger;
/**
* <description>
*
* @see <related>
* @author Rickard �berg ([EMAIL PROTECTED])
* @author <a href="mailto:[EMAIL PROTECTED]>Marc Fleury</a>
* @version $Revision: 1.1 $
*/
public class StatefulHandleImpl
implements Handle
{
// Constants -----------------------------------------------------
// Attributes ----------------------------------------------------
String name;
Object id;
// Static --------------------------------------------------------
// Constructors --------------------------------------------------
public StatefulHandleImpl(String name, Object id)
{
this.name = name;
this.id = id;
}
// Public --------------------------------------------------------
// Handle implementation -----------------------------------------
public EJBObject getEJBObject()
throws RemoteException
{
try
{
Object home = new InitialContext().lookup(name);
// We need to wire the server to retrieve the instance with the right
id
throw new Exception("StatefulHandleImpl.getEJBObject() NYI");
} catch (Exception e)
{
throw new ServerException("Could not get EJBObject", e);
}
}
// Package protected ---------------------------------------------
// Protected -----------------------------------------------------
// Private -------------------------------------------------------
// Inner classes -------------------------------------------------
}