Search in sources :

Example 1 with DefaultCommunicationClientImpl

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

the class ArbitrateCommmunicationClient method callManager.

/**
     * 指定manager,进行event调用
     * 
     * <pre>
     * 注意:该方法为异步调用
     * </pre>
     */
public void callManager(final Event event, final Callback callback) {
    if (delegate instanceof DefaultCommunicationClientImpl) {
        DefaultCommunicationClientImpl defaultClient = (DefaultCommunicationClientImpl) delegate;
        defaultClient.submit(new Runnable() {

            @Override
            public void run() {
                Object result = callManager(event);
                callback.call(result);
            }
        });
    }
}
Also used : DefaultCommunicationClientImpl(com.alibaba.otter.shared.communication.core.impl.DefaultCommunicationClientImpl)

Example 2 with DefaultCommunicationClientImpl

use of com.alibaba.otter.shared.communication.core.impl.DefaultCommunicationClientImpl 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 DefaultCommunicationClientImpl

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

the class DubboCommunicationTest method initial.

@BeforeClass
public void initial() {
    DubboCommunicationEndpoint endpoint2088 = new DubboCommunicationEndpoint(2088);
    endpoint2088.initial();
    DubboCommunicationEndpoint endpoint2089 = new DubboCommunicationEndpoint(2089);
    endpoint2089.initial();
    CommunicationConnectionFactory factory = new DubboCommunicationConnectionFactory();
    client = new DefaultCommunicationClientImpl(factory);
    client.initial();
}
Also used : DubboCommunicationConnectionFactory(com.alibaba.otter.shared.communication.core.impl.dubbo.DubboCommunicationConnectionFactory) DubboCommunicationEndpoint(com.alibaba.otter.shared.communication.core.impl.dubbo.DubboCommunicationEndpoint) DefaultCommunicationClientImpl(com.alibaba.otter.shared.communication.core.impl.DefaultCommunicationClientImpl) CommunicationConnectionFactory(com.alibaba.otter.shared.communication.core.impl.connection.CommunicationConnectionFactory) DubboCommunicationConnectionFactory(com.alibaba.otter.shared.communication.core.impl.dubbo.DubboCommunicationConnectionFactory) BeforeClass(org.testng.annotations.BeforeClass)

Aggregations

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