Examples of ServiceRegistry


Examples of com.arjuna.webservices11.ServiceRegistry

    {
        ServletContext context = servletContextEvent.getServletContext();
        String baseURI = context.getInitParameter("BaseURI");
        final String uri = baseURI + "/InitiatorService";

        final ServiceRegistry serviceRegistry = ServiceRegistry.getRegistry() ;
        serviceRegistry.registerServiceProvider(InteropConstants.SERVICE_INITIATOR, uri) ;
    }
View Full Code Here

Examples of com.google.refine.org.deri.reconcile.ServiceRegistry

  }
 
  @Test
  public void saveServiceTest() throws JSONException, IOException{
    String id = "sparql-test";
    ServiceRegistry registry = new ServiceRegistry(new GRefineJsonUtilitiesImpl(),null);
    GRefineServiceManager manager = new GRefineServiceManager(registry, dir);
   
    ReconciliationService service = new RdfReconciliationService(id, id, new QueryEndpointImpl(new LarqSparqlQueryFactory(), new RemoteQueryExecutor(url, null)), 0);
    manager.addService(service);
   
    assertTrue(registry.hasService(id));
    //verify service is saved
   
    registry = new ServiceRegistry(new GRefineJsonUtilitiesImpl(),null);
    //verify no service
    assertFalse(registry.hasService(id));
   
    File file = new File(dir,"services");
    //verify saved
    assertTrue(file.exists());
   
    FileInputStream in = new FileInputStream(file);

    registry.loadFromFile(in);
    //verify service is loaded
    verifyCorrectService(registry.getService(id, null), service);
  }
View Full Code Here

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

Examples of eu.planets_project.ifr.core.servreg.api.ServiceRegistry

     * @throws MalformedURLException
     */
    @Test
    public void usage() throws MalformedURLException {
        /* We retrieve an instance of the registry: */
        ServiceRegistry registry = ServiceRegistryFactory.getServiceRegistry();
        registry.clear(); // clear any old local entries
        URL endpoint1 = new URL("http://some.dummy.endpoint");
        URL endpoint2 = new URL("http://another.dummy.endpoint");
        /* We register service descriptions: */
        registry
                .register(/* new Droid().describe() */new ServiceDescription.Builder(
                        "Droid", Identify.class.getName()).endpoint(endpoint1)
                        .build());
        /* We can register supported migration paths with the service description: */
        FormatRegistry formatRegistry = FormatRegistryFactory.getFormatRegistry();
        MigrationPath path = new MigrationPath(formatRegistry.createExtensionUri("jpg"),
                formatRegistry.createExtensionUri("bmp"), null);
        registry
                .register(/* new SanselanMigrate().describe() */new ServiceDescription.Builder(
                        "Sanselan", Migrate.class.getName())
                        .endpoint(endpoint2).paths(path).build());
        /* And can then query by example, e.g. for migration services supporting the path: */
        ServiceDescription example = new ServiceDescription.Builder(null, Migrate.class
                .getName()).paths(path).build();
        List<ServiceDescription> migrationServices = registry.query(example);
        /* Which we expect to return only the compatible migration service: */
        Assert.assertEquals(1, migrationServices.size());
        Assert.assertEquals("Sanselan", migrationServices.get(0).getName());
        /* For further example on queries see CoreRegistryTests */
    }
View Full Code Here

Examples of javax.imageio.spi.ServiceRegistry

  implements Testlet
{
  public void test(TestHarness h)
  {
    Throwable caught;
    ServiceRegistry registry;
    SomeService s1 = new SomeService();
    TestService s2 = new TestService();

    List categories = new LinkedList();
    categories.add(SomeService.class);
    categories.add(RegisterableService.class);
    registry = new ServiceRegistry(categories.iterator());
    registry.registerServiceProvider(s1);
    registry.registerServiceProvider(s2);

    // Check #1: Null argument --> IllegalArgumentException.
    caught = null;
    try
      {
        registry.deregisterAll(null);
      }
    catch (Exception ex)
      {
        caught = ex;
      }
    h.check(caught instanceof IllegalArgumentException);

    // Check #2: Unregistered category --> IllegalArgumentException.
    caught = null;
    try
      {
        registry.deregisterAll(String.class);
      }
    catch (Exception ex)
      {
        caught = ex;
      }
    h.check(caught instanceof IllegalArgumentException);

    // Check #3: De-registered all SomeServices.
    registry.deregisterAll(SomeService.class);
    h.check(!registry.contains(s1));

    // Check #4: Did not de-register TestService.
    h.check(registry.contains(s2) && s2.numRegistrations == 1);
  }
View Full Code Here

Examples of nextapp.echo2.webrender.ServiceRegistry

   
    /**
     * Test basic add/get/remove functionality of <code>ServiceRegistry</code>.
     */
    public void testBasic() {
        ServiceRegistry services = new ServiceRegistry();
        NullService alpha = new NullService("alpha");
        services.add(alpha);
        NullService bravo = new NullService("bravo");
        services.add(bravo);
        assertEquals(alpha, services.get("alpha"));
        assertEquals(bravo, services.get("bravo"));
        assertNull(services.get("charlie"));
        services.remove(bravo);
        assertNull(services.get("bravo"));
    }
View Full Code Here

Examples of org.alfresco.service.ServiceRegistry

    List<String> spaceTypes = configService.getConfig(ConfigurationConfig.class).getConfiguration().getList(
        configKey);
    List<JsonModelEntry> model = new ArrayList<JsonModelEntry>();
    for (String type : spaceTypes) {
      try {
        ServiceRegistry serviceRegistry = AlfrescoUtil.getServiceRegistry();
        QName qName = QName.createQName(type, serviceRegistry.getNamespaceService());
        TypeDefinition td = serviceRegistry.getDictionaryService().getType(qName);
        if (td != null) {
          String title = td.getTitle();
          if (StringUtils.isEmpty(title)) {
            title = type;
          }
View Full Code Here

Examples of org.apache.felix.framework.ServiceRegistry

                }
            }
        };

        Logger logger = new Logger();
        ServiceRegistry registry = new ServiceRegistry(logger, null);
        registry.registerService(b4.getBundleContext(), new String [] {EventHook.class.getName()}, eh1, new Hashtable());
        registry.registerService(b4.getBundleContext(), new String [] {EventHook.class.getName()}, eh2, new Hashtable());

        // -- Set up event dispatcher
        EventDispatcher ed = new EventDispatcher(logger, registry);

        // -- Register some listeners
View Full Code Here

Examples of org.apache.felix.ipojo.context.ServiceRegistry

  }
 
  public void testGetService() {
    ComponentInstance im = new FakeComponent();
    ComponentInstance im2 = new FakeComponent();
    ServiceRegistry registry = new ServiceRegistry(getContext());
   
    try {
      assertNull("Check that there is no available service", registry.getServiceReferences(null, null));
    } catch (InvalidSyntaxException e) { fail("Cannot query the registry : " + e.getMessage()); }
   
    Properties props = new Properties();
    props.put("foo", "bar");
    ServiceRegistration reg1 = registry.registerService(im, BarService.class.getName(), new barProvider(), props);
   
    ServiceReference ref = registry.getServiceReference(BarService.class.getName());
    assertNotNull("Check ref not null", ref);
    assertEquals("Test property", ref.getProperty("foo"), "bar");
    BarService bar = (BarService) registry.getService(im2, ref);
    assertTrue("Test invocation", bar.bar());
   
    reg1.unregister();
    ref = registry.getServiceReference(BarService.class.getName());
    assertNull("Check ref null", ref);
  }
View Full Code Here

Examples of org.apache.felix.ipojo.context.ServiceRegistry

  }
 
  public void testGetFilteredService() {
    ComponentInstance im = new FakeComponent();
    ComponentInstance im2 = new FakeComponent();
    ServiceRegistry registry = new ServiceRegistry(getContext());
   
    try {
      assertNull("Check that there is no available service", registry.getServiceReferences(null, null));
    } catch (InvalidSyntaxException e) { fail("Cannot query the registry : " + e.getMessage()); }
   
    Properties props = new Properties();
    props.put("foo", "bar");
    ServiceRegistration reg1 = registry.registerService(im, BarService.class.getName(), new barProvider(), props);
    ServiceRegistration reg2 = registry.registerService(im2, BarService.class.getName(), new barProvider(), null);
   
    ServiceReference[] ref = null;
    try {
      ref = registry.getServiceReferences(BarService.class.getName(), "(foo=bar)");
    } catch (InvalidSyntaxException e) { fail("Registry query fail : " + e.getMessage()); }
    assertNotNull("Check ref not null", ref);
    assertEquals("Check ref count", ref.length, 1);
    assertEquals("Test property", ref[0].getProperty("foo"), "bar");
    BarService bar = (BarService) registry.getService(im2, ref[0]);
    assertTrue("Test invocation", bar.bar());
   
    ref = null;
    reg1.unregister();
    try {
      ref = registry.getServiceReferences(BarService.class.getName(), "(bar=foo)");
    } catch (InvalidSyntaxException e) { fail("Registry query fail : " + e.getMessage()); }
    assertNull("Check ref null", ref);
   
    reg2.unregister();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.