Examples of Registry


Examples of org.exolab.jms.net.registry.Registry

        }
        if (password != null) {
            properties.put(ORB.SECURITY_CREDENTIALS, password);
        }

        Registry registry;
        try {
            ORB orb = SharedORB.getInstance();
            registry = orb.getRegistry(properties);
        } catch (RemoteException exception) {
            JMSException error = new JMSException(
                    "Failed to get registry service for URL: " + url);
            error.setLinkedException(exception);
            throw error;
        }

        RemoteJmsAdminServerIfc admin = null;
        try {
            admin = (RemoteJmsAdminServerIfc) registry.lookup("admin");
            _connection = admin.createConnection(username, password);
        } catch (NotBoundException exception) {
            throw new JMSException("Administration server is not bound in the registry for "
                    + "URL: " + url);
        } catch (RemoteException exception) {
View Full Code Here

Examples of org.foo.dosgi.registry.Registry

      super(ctx, Registry.class.getName(), null);
    }

    @Override
    public Object addingService(ServiceReference reference) {
      Registry registry = (Registry) super.addingService(reference);
      String[] intents = PropertyUtil.toStringArray(reference
          .getProperty("remote.intents.supported"));
      String[] configs = PropertyUtil.toStringArray(reference
          .getProperty("remote.configs.supported"));
      bindRegistry(registry, intents, configs);
View Full Code Here

Examples of org.groovymud.object.registry.Registry

public class EngineLoadTest extends TestCase {

  public void testLoad() throws InterruptedException {
    InventoryHandler handler = new InventoryHandler();
    final Registry reg = new Registry(handler) {

    };

    final JMudEngine engine = new JMudEngine() {

      @Override
      public ShutdownBehaviour createShutdownBehaviour() {
        // TODO Auto-generated method stub
        return null;
      }

      @Override
      public Registry getObjectRegistry() {
        // TODO Auto-generated method stub
        return reg;
      }

      @Override
      protected void handleTheNetDead() {

      }

      @Override
      protected void savePlayers() {
        // TODO Auto-generated method stub

      }

      @Override
      protected void resetRooms() {

      }

      @Override
      protected void checkPlayerHandles() {
      }

      @Override
      protected void doHeartBeat() {

        super.doHeartBeat();
      }
    };
    engine.setExecutor(Executors.newCachedThreadPool());
    engine.setRunning(true);
    engine.start();
    Thread.sleep(1000);
    for (int x = 0; x < 10000000; x++) {
      MockMudObject obj = new MockMudObject() {

        @Override
        public void heartBeat() {
          if ("wombat0".equals(getName())) {
            logging = true;
          }
          super.heartBeat();
        }
      };
      obj.setName("wombat" + x);

      if (reg.getMudObjects().size() % 1000 == 0) {
        System.out.println("objects.size: " + reg.getMudObjects().size());
      }
      reg.addMudObject(obj);
      Thread.yield();
    }

    Thread.sleep(10000);
    for (int x = 0; x < 10000000; x++) {
      reg.removeMudObject((MudObject) reg.getMudObjects().toArray()[reg.getMudObjects().size() - 1]);
      Thread.yield();
    }
    engine.requestShutDown(null);
  }
View Full Code Here

Examples of org.impalaframework.registry.Registry

        Assert.notNull(beanFactory, "beanFactory cannot be null");
        Assert.notNull(contributions, "contributions cannot be null");
       
        Object registryBean = beanFactory.getBean(registryBeanName);
   
        final Registry registry = ObjectUtils.cast(registryBean, Registry.class);
        final Set<String> keys = contributions.keySet();
       
        for (String key : keys) {
                final String registrationKey = contributions.get(key);
                final Object bean = beanFactory.getBean(key);
                if (bean != null) {
                    try {
                        registry.addItem(registrationKey, bean);
                    } catch (ClassCastException e) {
                        throw new ConfigurationException("Bean '" + key + "' is not type compatible with " +
                                "registry bean '" + registryBeanName + "'");
                    }
                }
View Full Code Here

Examples of org.infoglue.cms.entities.management.Registry

    return registryVO;
  }

  public Registry getRegistryWithId(Integer registryId, Database db) throws SystemException, Exception
  {
    Registry registry = (RegistryImpl)getObjectWithId(RegistryImpl.class, registryId, db);

    return registry;
  }
View Full Code Here

Examples of org.jamesii.core.Registry

  /**
   * Constructor
   */
  public FormalismListModel() {
    Registry registry = SimSystem.getRegistry();

    List<ModelFactory> factories = null;

    factories =
        registry.getFactoryOrEmptyList(AbstractModelFactory.class, null);

    Collections.sort(factories, new Comparator<ModelFactory>() {

      @Override
      public int compare(ModelFactory o1, ModelFactory o2) {
View Full Code Here

Examples of org.jboss.resteasy.spi.Registry

   public void contextInitialized(final ServletContextEvent event)
   {
      super.contextInitialized(event);
      final ServletContext context = event.getServletContext();
      final Registry registry = (Registry) context.getAttribute(Registry.class.getName());
      final ResteasyProviderFactory providerFactory = (ResteasyProviderFactory) context.getAttribute(ResteasyProviderFactory.class.getName());
      final ModuleProcessor processor = new ModuleProcessor(registry, providerFactory);
      final List<Module> modules = getModules(context);
      final Stage stage = getStage(context);
      if (stage == null)
View Full Code Here

Examples of org.jboss.resteasy.spi.Registry

      {
         NotFoundException notFound = new NotFoundException("Null subresource for path: " + request.getUri().getAbsolutePath());
         notFound.setLoggable(true);
         throw notFound;
      }
      Registry registry = cachedSubresources.get(target.getClass());
      if (registry == null)
      {
         registry = new ResourceMethodRegistry(providerFactory);
         Class subResourceClass = GetRestful.getSubResourceClass(target.getClass());
         if (subResourceClass == null)
         {
            String msg = "Subresource for target class has no jax-rs annotations.: " + target.getClass().getName();
            throw new InternalServerErrorException(msg);
         }
         registry.addResourceFactory(null, null, subResourceClass);
         cachedSubresources.putIfAbsent(target.getClass(), registry);
      }
      ResourceInvoker invoker = registry.getResourceInvoker(request);
      if (invoker == null)
      {
         NotFoundException notFound = new NotFoundException("No path match in subresource for: " + request.getUri().getAbsolutePath());
         notFound.setLoggable(true);
         throw notFound;
View Full Code Here

Examples of org.jboss.resteasy.spi.Registry

      final ResteasyProviderFactory providerFactory = (ResteasyProviderFactory) servletContext.getAttribute(ResteasyProviderFactory.class.getName());
      if (providerFactory == null)
         throw new RuntimeException("RESTeasy Provider Factory is null, do you have the ResteasyBootstrap listener configured?");


      final Registry registry = (Registry) servletContext.getAttribute(Registry.class.getName());
      if (registry == null)
         throw new RuntimeException("RESTeasy Registry is null, do ou have the ResteasyBootstrap listener configured?");

      final Dispatcher dispatcher = (Dispatcher) servletContext.getAttribute(Dispatcher.class.getName());
      if (dispatcher == null)
View Full Code Here

Examples of org.jboss.resteasy.spi.Registry

   }

   @Test
   public void testAcceptGet() throws Exception
   {
      Registry registry = new ResourceMethodRegistry(ResteasyProviderFactory.getInstance());
      registry.addPerRequestResource(WebResource.class);

      MediaType contentType = new MediaType("text", "plain");

      {
         ArrayList<MediaType> accepts = new ArrayList<MediaType>();
         accepts.add(MediaType.valueOf("application/foo"));
         ResourceMethod method = (ResourceMethod) registry.getResourceInvoker(createRequest("GET", "/", contentType, accepts));
         Assert.assertNotNull(method);
         Assert.assertEquals(WebResource.class.getMethod("doGetFoo"), method.getMethod());
      }

      {
         ArrayList<MediaType> accepts = new ArrayList<MediaType>();
         accepts.add(MediaType.valueOf("application/foo;q=0.1"));
         ResourceMethod method = (ResourceMethod) registry.getResourceInvoker(createRequest("GET", "/", contentType, accepts));
         Assert.assertNotNull(method);
         Assert.assertEquals(WebResource.class.getMethod("doGetFoo"), method.getMethod());
      }

      {
         ArrayList<MediaType> accepts = new ArrayList<MediaType>();
         accepts.add(MediaType.valueOf("application/foo"));
         accepts.add(MediaType.valueOf("application/bar;q=0.4"));
         accepts.add(MediaType.valueOf("application/baz;q=0.2"));
         ResourceMethod method = (ResourceMethod) registry.getResourceInvoker(createRequest("GET", "/", contentType, accepts));
         Assert.assertNotNull(method);
         Assert.assertEquals(WebResource.class.getMethod("doGetFoo"), method.getMethod());
      }

      {
         ArrayList<MediaType> accepts = new ArrayList<MediaType>();
         accepts.add(MediaType.valueOf("application/foo;q=0.4"));
         accepts.add(MediaType.valueOf("application/bar"));
         accepts.add(MediaType.valueOf("application/baz;q=0.2"));
         ResourceMethod method = (ResourceMethod) registry.getResourceInvoker(createRequest("GET", "/", contentType, accepts));
         Assert.assertNotNull(method);
         Assert.assertEquals(WebResource.class.getMethod("doGetBar"), method.getMethod());
      }

      {
         ArrayList<MediaType> accepts = new ArrayList<MediaType>();
         accepts.add(MediaType.valueOf("application/foo;q=0.4"));
         accepts.add(MediaType.valueOf("application/bar;q=0.2"));
         accepts.add(MediaType.valueOf("application/baz"));
         ResourceMethod method = (ResourceMethod) registry.getResourceInvoker(createRequest("GET", "/", contentType, accepts));
         Assert.assertNotNull(method);
         Assert.assertEquals(WebResource.class.getMethod("doGetBaz"), method.getMethod());
      }
   }
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.