1 6 7 package org.jfox.ioc.connector.soap; 8 9 import java.rmi.RemoteException ; 10 11 import org.jfox.ioc.connector.AbstractConnectorRemote; 12 import org.jfox.ioc.connector.ConnectorRemote; 13 import org.jfox.ioc.connector.Invocation; 14 import org.jfox.ioc.connector.ServerNode; 15 16 19 20 public class SOAPConnectorService extends AbstractConnectorRemote implements ConnectorRemote{ 21 private String httpHost = "localhost"; 23 private int httpPort = 8080; 25 private String servletName = "xmlrpc/RPC2"; 27 private SOAPConnectorRemote soapBinder = null; 29 30 public String getProtocol() throws RemoteException { 31 return "SOAP"; 32 } 33 34 public String getHttpHost() { 35 return httpHost; 36 } 37 38 public int getHttpPort() { 39 return httpPort; 40 } 41 42 public String getServletName() { 43 return servletName; 44 } 45 46 public void setHttpHost(String httpHost) { 47 this.httpHost = httpHost; 48 } 49 50 public void setHttpPort(int httpPort) { 51 this.httpPort = httpPort; 52 } 53 54 protected void doStart() throws Exception { 55 logger.info("soap url: " + getSoapURL()); 56 ServerNode.THE_NODE.registerConnector(getProtocol(),soapBinder); 57 } 58 59 protected void doStop() throws Exception { 60 ServerNode.THE_NODE.unregisterConnector(getProtocol()); 61 } 62 63 protected void doInit() throws Exception { 64 soapBinder = new SOAPConnectorRemote(getSoapURL()); 65 } 66 67 protected void doDestroy() throws Exception { 68 soapBinder = null; 69 } 70 71 public String getSoapURL() { 72 return "http://" + httpHost + ":" + httpPort + "/" + servletName; 73 } 74 75 82 public Object invoke(Invocation invocation) throws RemoteException { 83 return soapBinder.invoke(invocation); 84 95 } 96 97 public static void main(String [] args) { 98 99 } 100 101 } | Popular Tags |