Package de.bamberg.ha.api.processing

Examples of de.bamberg.ha.api.processing.ServiceRegistry



  @Override
  public DistributedExecutionResult call() throws Exception {
    Object callResult=null;
    ServiceRegistry serviceRegistry=CentralServiceRegistryHolder.getInstance().getServiceRegistry();
    if (serviceRegistry!=null) {
      Object obj=serviceRegistry.lookup(serviceName);
      Method method=obj.getClass().getMethod(methodName, determineParameterClasses(parameter) );
      callResult=method.invoke(obj, parameter);
    }
    DistributedExecutionResult result=new DistributedExecutionResult(callResult);
    return result;
View Full Code Here


public class DefaultServiceRegistryTest {

  @Test
  public void testRegisterService() throws Exception {
    ServiceRegistry registry=DefaultServiceRegistry.getInstance();
    TestService ts=new TestServiceImpl();
    registry.registerService(ts, TestService.class,TestService2.class);
   
    TestService service1=(TestService) registry.lookup(TestService.class);
    assertNotNull(service1);
    TestService service2=(TestService) registry.lookup(TestService2.class);
    assertNotNull(service2);

    assertTrue(ts==service1);
    assertTrue(ts==service2);
    assertTrue(service1==service2);
View Full Code Here

        return null;
      }
     
    };
   
    registryMock=new ServiceRegistry() {
     
     
      @Override
      public void registerService(Object service, Class... interfaces) {
      }
View Full Code Here

   
  }

  @Test (expected=ServiceNotAvailableException.class)
  public void testLookupUnknownService() throws Exception {
    ServiceRegistry registry=DefaultServiceRegistry.getInstance();
    registry.lookup(TestService3.class);
  }
View Full Code Here

TOP

Related Classes of de.bamberg.ha.api.processing.ServiceRegistry

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.