Changeset 29749

Show
Ignore:
Timestamp:
01/28/08 23:10:59 (10 months ago)
Author:
bstefanescu
Message:

wokring on auto config

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  
    2020package org.nuxeo.runtime.config; 
    2121 
     22import java.net.MalformedURLException; 
    2223import java.util.HashMap; 
    2324import java.util.Map; 
     
    7071    } 
    7172 
    72     public void load(String host, int port, String protocol) throws Exception { 
     73    public void load(String protocol, String host, int port) throws Exception { 
    7374        HashMap<String,String> params = new HashMap<String,String>(); 
    7475        params.put("datatype", "nuxeo"); 
     
    7778 
    7879    public void load(String host, int port) throws Exception { 
    79         load(host, port, "socket"); 
     80        load("socket", host, port); 
    8081    } 
    8182 
     
    129130    } 
    130131 
     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 
    131158} 
  • org.nuxeo.runtime/trunk/nuxeo-runtime/src/main/java/org/nuxeo/runtime/remoting/RemotingService.java

    r29721 r29749  
    3030import org.jboss.remoting.marshal.serializable.SerializableMarshaller; 
    3131import org.nuxeo.runtime.api.Framework; 
     32import org.nuxeo.runtime.config.AutoConfigurationService; 
    3233import org.nuxeo.runtime.config.ConfigurationFactory; 
    3334import org.nuxeo.runtime.config.v1.ConfigurationFactory1; 
     
    4445 */ 
    4546public class RemotingService extends DefaultComponent { 
     47 
     48    public final static String INVOKER_NAME = "nx:service=invoker,name=remoting"; 
    4649 
    4750    public static final ComponentName NAME = new ComponentName( 
     
    8285    } 
    8386 
     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     */ 
    8495    public static final String getServerURI(String host, int port) { 
    8596        return "socket://" + host + ":" + port+"/?datatype=nuxeo"; 
     
    90101     * 
    91102     * @return the product info if successful, null otherwise 
     103     * @deprecated should no more be used - use instead {@link AutoConfigurationService} 
    92104     */ 
    93105    public static String ping(String host, int port) { 
     
    127139            if (mb != null) { 
    128140                mb.registerMBean(transporterServer.getConnector().getServerInvoker(), 
    129                         new ObjectName("nx:service=invoker,name=remoting")); 
     141                        new ObjectName(INVOKER_NAME)); 
    130142            } 
    131143        }