01: /**
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */package org.apache.openejb.server.ejbd;
17:
18: import java.io.IOException;
19: import java.io.InputStream;
20: import java.io.OutputStream;
21: import java.net.Socket;
22: import java.util.Properties;
23:
24: import org.apache.openejb.server.ServiceException;
25: import org.apache.openejb.core.ServerFederation;
26: import org.apache.openejb.ProxyInfo;
27:
28: import javax.ejb.EJBMetaData;
29: import javax.ejb.Handle;
30: import javax.ejb.HomeHandle;
31: import javax.ejb.EJBObject;
32: import javax.ejb.EJBHome;
33:
34: public class EjbServer implements
35: org.apache.openejb.server.ServerService,
36: org.apache.openejb.spi.ApplicationServer {
37:
38: EjbDaemon server;
39:
40: public void init(Properties props) throws Exception {
41: server = EjbDaemon.getEjbDaemon();
42: server.init(props);
43: }
44:
45: public void start() throws ServiceException {
46: }
47:
48: public void stop() throws ServiceException {
49: }
50:
51: public String getName() {
52: return "ejbd";
53: }
54:
55: public int getPort() {
56: return 0;
57: }
58:
59: public void service(Socket socket) throws ServiceException,
60: IOException {
61: ServerFederation.setApplicationServer(server);
62: server.service(socket);
63: }
64:
65: public void service(InputStream inputStream,
66: OutputStream outputStream) throws ServiceException,
67: IOException {
68: ServerFederation.setApplicationServer(server);
69: server.service(inputStream, outputStream);
70: }
71:
72: public String getIP() {
73: return "";
74: }
75:
76: public EJBMetaData getEJBMetaData(ProxyInfo info) {
77: return server.getEJBMetaData(info);
78: }
79:
80: public Handle getHandle(ProxyInfo info) {
81: return server.getHandle(info);
82: }
83:
84: public HomeHandle getHomeHandle(ProxyInfo info) {
85: return server.getHomeHandle(info);
86: }
87:
88: public EJBObject getEJBObject(ProxyInfo info) {
89: return server.getEJBObject(info);
90: }
91:
92: public Object getBusinessObject(ProxyInfo info) {
93: return server.getBusinessObject(info);
94: }
95:
96: public EJBHome getEJBHome(ProxyInfo info) {
97: return server.getEJBHome(info);
98: }
99: }
|