1 18 package org.apache.geronimo.interop.rmi.iiop.server; 19 20 import java.net.Socket ; 21 import java.util.ArrayList ; 22 import java.util.Properties ; 23 24 import org.apache.commons.logging.Log; 25 import org.apache.commons.logging.LogFactory; 26 import org.apache.geronimo.gbean.GBeanInfo; 27 import org.apache.geronimo.gbean.GBeanInfoBuilder; 28 import org.apache.geronimo.interop.adapter.AdapterManager; 29 30 public class RmiIiopServerGBean { 32 33 private final Log log = LogFactory.getLog(RmiIiopServerGBean.class); 34 35 private MessageHandler msgHandler; 36 private ArrayList args = new ArrayList (); 37 private Properties props = new Properties (); 38 private boolean simpleIDL = false; 39 private boolean writeSystemExceptionStackTrace = false; 40 private AdapterManager adapterManager; 41 42 public RmiIiopServerGBean(AdapterManager adapterManager, ArrayList args, Properties props, 43 boolean simpleIDL, boolean writeSystemExceptionStackTrace ) { 44 this.adapterManager = adapterManager; 45 this.args = args; 46 this.props = props; 47 this.simpleIDL = simpleIDL; 48 this.writeSystemExceptionStackTrace = writeSystemExceptionStackTrace; 49 this.msgHandler = new MessageHandler( this.adapterManager, this.simpleIDL, 50 this.writeSystemExceptionStackTrace ); 51 52 } 53 54 public RmiIiopServerGBean() throws Exception { 55 this.adapterManager = null; 56 this.args = null; 57 this.props = null; 58 this.simpleIDL = false; 59 this.writeSystemExceptionStackTrace = false; 60 this.msgHandler = null; 61 } 62 63 public void service(Socket socket) throws Exception { 64 log.debug( "RmiIiopServerGBean.service(): socket = " + socket ); 65 msgHandler.service(socket); 66 } 67 68 public void init(Properties properties) throws Exception 69 { 70 } 72 73 public void start() throws Exception { 74 log.debug( "RmiIiopServerGBean.start(): " ); 75 } 76 77 public void stop() throws Exception { 78 log.debug( "RmiIiopServerGBean.stop(): " ); 79 } 80 81 public String getName() { 82 return "rmiiiopd"; 83 } 84 85 104 105 109 110 private int port; 111 private String ip; 112 113 public void setPort( int port ) 114 { 115 log.debug( "RmiIiopServerGBean.setPort(): port = " + port ); 116 this.port = port; 117 } 118 119 public int getPort() { 120 return port; 121 } 122 123 public void setIP( String ip ) 124 { 125 log.debug( "RmiIiopServerGBean.setIP(): ip = " + ip ); 126 this.ip = ip; 127 } 128 129 public String getIP() { 130 return ""; 131 } 132 133 public static final GBeanInfo GBEAN_INFO; 134 135 static { 136 GBeanInfoBuilder infoFactory = new GBeanInfoBuilder(RmiIiopServerGBean.class); 137 138 140 infoFactory.addAttribute("args", ArrayList .class, true); 141 infoFactory.addAttribute("props", Properties .class, true); 142 infoFactory.addAttribute("simpleIDL", boolean.class, true); 143 infoFactory.addAttribute("writeSystemExceptionStackTrace", boolean.class, true); 144 infoFactory.addReference("adapterManager", AdapterManager.class); 145 146 infoFactory.setConstructor(new String []{"adapterManager", "args", "props", "simpleIDL", "writeSystemExceptionStackTrace"}); 147 148 GBEAN_INFO = infoFactory.getBeanInfo(); 149 } 150 151 public static GBeanInfo getGBeanInfo() { 152 return GBEAN_INFO; 153 } 154 } 155 156 | Popular Tags |