Search in sources :

Example 1 with RmiCommunicationEndpoint

use of com.alibaba.otter.shared.communication.core.impl.rmi.RmiCommunicationEndpoint in project otter by alibaba.

the class NodeCommunicationEndpoint method afterPropertiesSet.

public void afterPropertiesSet() throws Exception {
    // String ip = config.currentNode().getIp();
    Long port = configClientService.currentNode().getPort();
    if (endpoint instanceof RmiCommunicationEndpoint) {
        RmiCommunicationEndpoint rmiEndpoint = (RmiCommunicationEndpoint) endpoint;
        // rmiEndpoint.setHost(ip);
        rmiEndpoint.setPort(port.intValue());
    }
    if (endpoint instanceof DubboCommunicationEndpoint) {
        DubboCommunicationEndpoint dubboEndpoint = (DubboCommunicationEndpoint) endpoint;
        dubboEndpoint.setPort(port.intValue());
    }
    endpoint.initial();
}
Also used : RmiCommunicationEndpoint(com.alibaba.otter.shared.communication.core.impl.rmi.RmiCommunicationEndpoint) DubboCommunicationEndpoint(com.alibaba.otter.shared.communication.core.impl.dubbo.DubboCommunicationEndpoint)

Example 2 with RmiCommunicationEndpoint

use of com.alibaba.otter.shared.communication.core.impl.rmi.RmiCommunicationEndpoint in project otter by alibaba.

the class RmiCommunicationTest method initial.

@BeforeClass
public void initial() {
    RmiCommunicationEndpoint endpoint1099 = new RmiCommunicationEndpoint(1099);
    endpoint1099.setAlwaysCreateRegistry(false);
    endpoint1099.initial();
    RmiCommunicationEndpoint endpoint1098 = new RmiCommunicationEndpoint(1098);
    endpoint1098.setAlwaysCreateRegistry(false);
    endpoint1098.initial();
    CommunicationConnectionPoolFactory factory = new CommunicationConnectionPoolFactory(new RmiCommunicationConnectionFactory());
    factory.initial();
    client = new DefaultCommunicationClientImpl(factory);
    client.initial();
}
Also used : CommunicationConnectionPoolFactory(com.alibaba.otter.shared.communication.core.impl.connection.CommunicationConnectionPoolFactory) RmiCommunicationEndpoint(com.alibaba.otter.shared.communication.core.impl.rmi.RmiCommunicationEndpoint) RmiCommunicationConnectionFactory(com.alibaba.otter.shared.communication.core.impl.rmi.RmiCommunicationConnectionFactory) DefaultCommunicationClientImpl(com.alibaba.otter.shared.communication.core.impl.DefaultCommunicationClientImpl) BeforeClass(org.testng.annotations.BeforeClass)

Example 3 with RmiCommunicationEndpoint

use of com.alibaba.otter.shared.communication.core.impl.rmi.RmiCommunicationEndpoint in project otter by alibaba.

the class RmiConnectionTest method initial.

@BeforeClass
public void initial() {
    // 创建endpoint
    RmiCommunicationEndpoint endpoint = new RmiCommunicationEndpoint(1099);
    endpoint.setAlwaysCreateRegistry(false);
    endpoint.initial();
}
Also used : RmiCommunicationEndpoint(com.alibaba.otter.shared.communication.core.impl.rmi.RmiCommunicationEndpoint) BeforeClass(org.testng.annotations.BeforeClass)

Aggregations

RmiCommunicationEndpoint (com.alibaba.otter.shared.communication.core.impl.rmi.RmiCommunicationEndpoint)3 BeforeClass (org.testng.annotations.BeforeClass)2 DefaultCommunicationClientImpl (com.alibaba.otter.shared.communication.core.impl.DefaultCommunicationClientImpl)1 CommunicationConnectionPoolFactory (com.alibaba.otter.shared.communication.core.impl.connection.CommunicationConnectionPoolFactory)1 DubboCommunicationEndpoint (com.alibaba.otter.shared.communication.core.impl.dubbo.DubboCommunicationEndpoint)1 RmiCommunicationConnectionFactory (com.alibaba.otter.shared.communication.core.impl.rmi.RmiCommunicationConnectionFactory)1