| Method from org.apache.openejb.server.ejbd.EjbDaemon Detail: |
public Object getBusinessObject(ProxyInfo info) {
return clientObjectFactory.getBusinessObject(info);
}
|
protected DeploymentInfo getDeployment(EJBRequest req) throws RemoteException {
String deploymentId = req.getDeploymentId();
DeploymentInfo deploymentInfo = containerSystem.getDeploymentInfo(deploymentId);
if (deploymentInfo == null) throw new RemoteException("No deployment: "+deploymentId);
return deploymentInfo;
}
|
public EJBHome getEJBHome(ProxyInfo info) {
return clientObjectFactory.getEJBHome(info);
}
|
public EJBMetaData getEJBMetaData(ProxyInfo info) {
return clientObjectFactory.getEJBMetaData(info);
}
|
public EJBObject getEJBObject(ProxyInfo info) {
return clientObjectFactory.getEJBObject(info);
}
|
public static EjbDaemon getEjbDaemon() {
if (thiss == null) {
thiss = new EjbDaemon();
}
return thiss;
}
|
public Handle getHandle(ProxyInfo info) {
return clientObjectFactory.getHandle(info);
}
|
public HomeHandle getHomeHandle(ProxyInfo info) {
return clientObjectFactory.getHomeHandle(info);
}
|
public void init(Properties props) throws Exception {
containerSystem = SystemInstance.get().getComponent(ContainerSystem.class);
// deploymentIndex = new DeploymentIndex(containerSystem.deployments());
clientObjectFactory = new ClientObjectFactory(this, props);
ejbHandler = new EjbRequestHandler(this);
jndiHandler = new JndiRequestHandler(this);
authHandler = new AuthRequestHandler(this);
}
|
public void processAuthRequest(ObjectInputStream in,
ObjectOutputStream out) {
authHandler.processRequest(in, out);
}
|
public void processEjbRequest(ObjectInputStream in,
ObjectOutputStream out) {
ejbHandler.processRequest(in, out);
}
|
public void processJndiRequest(ObjectInputStream in,
ObjectOutputStream out) throws Exception {
jndiHandler.processRequest(in, out);
}
|
public void service(Socket socket) throws IOException {
InputStream in = socket.getInputStream();
OutputStream out = socket.getOutputStream();
try {
service(in, out);
} finally {
try {
if (socket != null) socket.close();
} catch (Throwable t) {
logger.error("Encountered problem while closing connection with client: " + t.getMessage());
}
}
}
|
public void service(InputStream in,
OutputStream out) throws IOException {
ProtocolMetaData protocolMetaData = new ProtocolMetaData();
String requestTypeName = null;
ObjectInputStream ois = null;
ObjectOutputStream oos = null;
try {
protocolMetaData.readExternal(in);
PROTOCOL_VERSION.writeExternal(out);
byte requestType = (byte) in.read();
if (requestType == -1) {
return;
}
ois = new EjbObjectInputStream(in);
oos = new ObjectOutputStream(out);
// Exceptions should not be thrown from these methods
// They should handle their own exceptions and clean
// things up with the client accordingly.
switch (requestType) {
case RequestMethodConstants.EJB_REQUEST:
requestTypeName = "EJB_REQUEST";
processEjbRequest(ois, oos);
break;
case RequestMethodConstants.JNDI_REQUEST:
requestTypeName = "JNDI_REQUEST";
processJndiRequest(ois, oos);
break;
case RequestMethodConstants.AUTH_REQUEST:
requestTypeName = "AUTH_REQUEST";
processAuthRequest(ois, oos);
break;
default:
requestTypeName = requestType+" (UNKNOWN)";
logger.error("\"" + requestTypeName + " " + protocolMetaData.getSpec() + "\" FAIL \"Unknown request type " + requestType);
}
} catch (SecurityException e) {
logger.error("\""+requestTypeName +" "+ protocolMetaData.getSpec() + "\" FAIL \"Security error - "+e.getMessage()+"\"",e);
} catch (Throwable e) {
logger.error("\""+requestTypeName +" "+ protocolMetaData.getSpec() + "\" FAIL \"Unexpected error - "+e.getMessage()+"\"",e);
} finally {
try {
if (oos != null) {
oos.flush();
oos.close();
} else if (out != null) {
out.flush();
out.close();
}
} catch (Throwable t) {
logger.error("\""+requestTypeName +" "+ protocolMetaData.getSpec() + "\" FAIL \""+t.getMessage()+"\"");
}
}
}
|