Search in sources :

Example 1 with ECFException

use of org.eclipse.ecf.core.util.ECFException in project ecf by eclipse.

the class PublishedServiceDirectory method activated.

protected void activated(final ID sharedObjectID) {
    if (sharedObjectID.equals(config.getSharedObjectID())) {
        ISharedObjectManager mgr = config.getContext().getSharedObjectManager();
        if (discoveryAgentID == null) {
            try {
                discoveryAgentID = IDFactory.getDefault().createGUID();
                mgr.createSharedObject(createDiscoveryAgentDescription());
            } catch (ECFException e) {
                // TODO Log me!
                e.printStackTrace();
            }
        }
    }
}
Also used : ECFException(org.eclipse.ecf.core.util.ECFException) ISharedObjectManager(org.eclipse.ecf.core.sharedobject.ISharedObjectManager)

Example 2 with ECFException

use of org.eclipse.ecf.core.util.ECFException in project ecf by eclipse.

the class RpcRemoteServiceTest method testCallViaProxy2.

public void testCallViaProxy2() {
    IRemoteService rpcClientService = getRemoteServiceClientContainerAdapter(container).getRemoteService(registrationEchoProxy.getReference());
    try {
        IEcho echo = (IEcho) rpcClientService.getProxy();
        assertNotNull(echo);
        Object result = echo.echo(ECHO_TEST_DATA);
        assertNotNull(result);
        assertEquals(result, ECHO_TEST_DATA);
    } catch (ECFException e) {
        e.printStackTrace();
        fail("Could not contact the service");
    }
}
Also used : ECFException(org.eclipse.ecf.core.util.ECFException) IEcho(org.eclipse.ecf.tests.remoteservice.rpc.common.IEcho) IRemoteService(org.eclipse.ecf.remoteservice.IRemoteService)

Example 3 with ECFException

use of org.eclipse.ecf.core.util.ECFException in project ecf by eclipse.

the class RpcRemoteServiceTest method testCallViaProxy.

public void testCallViaProxy() {
    IRemoteService rpcClientService = getRemoteServiceClientContainerAdapter(container).getRemoteService(registrationEchoProxy.getReference());
    try {
        IEcho echo = (IEcho) rpcClientService.getProxy(Activator.class.getClassLoader(), new Class[] { IEcho.class });
        assertNotNull(echo);
        Object result = echo.echo(ECHO_TEST_DATA);
        assertNotNull(result);
        assertEquals(result, ECHO_TEST_DATA);
    } catch (ECFException e) {
        e.printStackTrace();
        fail("Could not contact the service");
    }
}
Also used : ECFException(org.eclipse.ecf.core.util.ECFException) IEcho(org.eclipse.ecf.tests.remoteservice.rpc.common.IEcho) IRemoteService(org.eclipse.ecf.remoteservice.IRemoteService)

Example 4 with ECFException

use of org.eclipse.ecf.core.util.ECFException in project ecf by eclipse.

the class TwitterRemoteServiceTest method testProxyCall.

public void testProxyCall() {
    IRemoteService restClientService = getRemoteServiceClientContainerAdapter(container).getRemoteService(registration.getReference());
    try {
        IUserTimeline userTimeline = (IUserTimeline) restClientService.getProxy();
        IUserStatus[] statuses = userTimeline.getUserStatuses();
        assertNotNull(statuses);
    } catch (ECFException e) {
        fail("Could not contact the service");
    }
}
Also used : ECFException(org.eclipse.ecf.core.util.ECFException) IRemoteService(org.eclipse.ecf.remoteservice.IRemoteService)

Example 5 with ECFException

use of org.eclipse.ecf.core.util.ECFException in project ecf by eclipse.

the class TwitterRemoteServiceTest method testSyncCallWithCountParameter1.

public void testSyncCallWithCountParameter1() {
    IRemoteService restClientService = getRemoteServiceClientContainerAdapter(container).getRemoteService(registration.getReference());
    try {
        Object result = restClientService.callSync(RestCallFactory.createRestCall(IUserTimeline.class.getName() + ".getUserStatuses", new String[] { "1" }));
        assertNotNull(result);
    } catch (ECFException e) {
        fail("Could not contact the service");
    }
}
Also used : ECFException(org.eclipse.ecf.core.util.ECFException) JSONObject(org.json.JSONObject) IRemoteService(org.eclipse.ecf.remoteservice.IRemoteService)

Aggregations

ECFException (org.eclipse.ecf.core.util.ECFException)42 IRemoteService (org.eclipse.ecf.remoteservice.IRemoteService)9 Iterator (java.util.Iterator)5 IStatus (org.eclipse.core.runtime.IStatus)5 ID (org.eclipse.ecf.core.identity.ID)5 Status (org.eclipse.core.runtime.Status)4 ContainerConnectException (org.eclipse.ecf.core.ContainerConnectException)4 IOException (java.io.IOException)3 IContainer (org.eclipse.ecf.core.IContainer)3 Action (org.eclipse.jface.action.Action)3 IAction (org.eclipse.jface.action.IAction)3 InvocationTargetException (java.lang.reflect.InvocationTargetException)2 Method (java.lang.reflect.Method)2 List (java.util.List)2 TimeoutException (java.util.concurrent.TimeoutException)2 Namespace (org.eclipse.ecf.core.identity.Namespace)2 IConnectContext (org.eclipse.ecf.core.security.IConnectContext)2 IUser (org.eclipse.ecf.core.user.IUser)2 IChatRoomInfo (org.eclipse.ecf.presence.chatroom.IChatRoomInfo)2 IEcho (org.eclipse.ecf.tests.remoteservice.rpc.common.IEcho)2