Changeset 29749
- Timestamp:
- 01/28/08 23:10:59 (10 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
org.nuxeo.runtime/trunk/nuxeo-runtime/src/main/java/org/nuxeo/runtime/config/AutoConfigurationService.java
r29721 r29749 20 20 package org.nuxeo.runtime.config; 21 21 22 import java.net.MalformedURLException; 22 23 import java.util.HashMap; 23 24 import java.util.Map; … … 70 71 } 71 72 72 public void load(String host, int port, String protocol) throws Exception {73 public void load(String protocol, String host, int port) throws Exception { 73 74 HashMap<String,String> params = new HashMap<String,String>(); 74 75 params.put("datatype", "nuxeo"); … … 77 78 78 79 public void load(String host, int port) throws Exception { 79 load( host, port, "socket");80 load("socket", host, port); 80 81 } 81 82 … … 129 130 } 130 131 132 133 public static InvokerLocator createLocator(String url) throws MalformedURLException { 134 InvokerLocator locator = new InvokerLocator(url); 135 return createLocator(locator.getProtocol(), locator.getHost(), locator.getPort(), locator.getPath(), locator.getParameters()); 136 } 137 138 public static InvokerLocator createLocator(String host, int port) { 139 return createLocator("socket", host, port, "", null); 140 } 141 142 public static InvokerLocator createLocator(String protocol, String host, int port) { 143 return createLocator(protocol, host, port, "", null); 144 } 145 146 public static InvokerLocator createLocator(String protocol, String host, int port, String path) { 147 return createLocator(protocol, host, port, path, null); 148 } 149 150 public static InvokerLocator createLocator(String protocol, String host, int port, String path, Map<String,String> params) { 151 if (params == null) { 152 params = new HashMap<String, String>(); 153 params.put(InvokerLocator.DATATYPE, "nuxeo"); 154 } 155 return new InvokerLocator(protocol, host, port, path, params); 156 } 157 131 158 } org.nuxeo.runtime/trunk/nuxeo-runtime/src/main/java/org/nuxeo/runtime/remoting/RemotingService.java
r29721 r29749 30 30 import org.jboss.remoting.marshal.serializable.SerializableMarshaller; 31 31 import org.nuxeo.runtime.api.Framework; 32 import org.nuxeo.runtime.config.AutoConfigurationService; 32 33 import org.nuxeo.runtime.config.ConfigurationFactory; 33 34 import org.nuxeo.runtime.config.v1.ConfigurationFactory1; … … 44 45 */ 45 46 public class RemotingService extends DefaultComponent { 47 48 public final static String INVOKER_NAME = "nx:service=invoker,name=remoting"; 46 49 47 50 public static final ComponentName NAME = new ComponentName( … … 82 85 } 83 86 87 /** 88 * 89 * @param host 90 * @param port 91 * @return 92 * 93 * @deprecated must be removed since from runtime 1.5.1 the invoker protocol may be configurable 94 */ 84 95 public static final String getServerURI(String host, int port) { 85 96 return "socket://" + host + ":" + port+"/?datatype=nuxeo"; … … 90 101 * 91 102 * @return the product info if successful, null otherwise 103 * @deprecated should no more be used - use instead {@link AutoConfigurationService} 92 104 */ 93 105 public static String ping(String host, int port) { … … 127 139 if (mb != null) { 128 140 mb.registerMBean(transporterServer.getConnector().getServerInvoker(), 129 new ObjectName( "nx:service=invoker,name=remoting"));141 new ObjectName(INVOKER_NAME)); 130 142 } 131 143 }
