Package org.picocontainer

Examples of org.picocontainer.ComponentAdapter$NOTHING


    * passed to the container's constructor.
    */
   public ComponentAdapter registerComponentImplementation(Object componentKey, Class componentImplementation,
      Parameter[] parameters) throws PicoRegistrationException
   {
      ComponentAdapter componentAdapter =
         componentAdapterFactory.createComponentAdapter(componentKey, componentImplementation, parameters);
      registerComponent(componentAdapter);
      return componentAdapter;
   }
View Full Code Here


      }

      Map<ComponentAdapter, Object> adapterToInstanceMap = new HashMap<ComponentAdapter, Object>();
      for (Iterator<ComponentAdapter> iterator = componentAdapters.iterator(); iterator.hasNext();)
      {
         ComponentAdapter componentAdapter = iterator.next();
         if (componentType.isAssignableFrom(componentAdapter.getComponentImplementation()))
         {
            Object componentInstance = getInstance(componentAdapter);
            adapterToInstanceMap.put(componentAdapter, componentInstance);

            // This is to ensure all are added. (Indirect dependencies will be added
View Full Code Here

      return result;
   }

   public Object getComponentInstance(Object componentKey) throws PicoException
   {
      ComponentAdapter componentAdapter = getComponentAdapter(componentKey);
      if (componentAdapter != null)
      {
         return getInstance(componentAdapter);
      }
      else
View Full Code Here

      }
   }

   public Object getComponentInstanceOfType(Class componentType)
   {
      final ComponentAdapter componentAdapter = getComponentAdapterOfType(componentType);
      return componentAdapter == null ? null : getInstance(componentAdapter);
   }
View Full Code Here

   public ComponentAdapter unregisterComponentByInstance(Object componentInstance)
   {
      for (Iterator<ComponentAdapter> iterator = componentAdapters.iterator(); iterator.hasNext();)
      {
         ComponentAdapter componentAdapter = iterator.next();
         if (getInstance(componentAdapter).equals(componentInstance))
         {
            return unregisterComponent(componentAdapter.getComponentKey());
         }
      }
      return null;
   }
View Full Code Here

   public void accept(PicoVisitor visitor)
   {
      visitor.visitContainer(this);
      for (Iterator<ComponentAdapter> iterator = componentAdapters.iterator(); iterator.hasNext();)
      {
         ComponentAdapter componentAdapter = iterator.next();
         componentAdapter.accept(visitor);
      }
      for (Iterator<PicoContainer> iterator = children.iterator(); iterator.hasNext();)
      {
         PicoContainer child = iterator.next();
         child.accept(visitor);
View Full Code Here

         {
            log.error("Cannot add configuration " + overrideConfig + ". ServletContext: " + context, ex);
         }

         cService.processRemoveConfiguration();
         ComponentAdapter adapter = pcontainer.registerComponentInstance(ConfigurationManager.class, cService);
         pcontainer.initContainer();
         registerComponentInstance(portalContainerName, pcontainer);
         pcontainer.start();

         // Register the portal as an mbean
View Full Code Here

      List adapters = repositoryContainer.getComponentAdaptersOfType(WorkspaceContainer.class);
      List<String> workspaceNames = new ArrayList<String>();
      for (int i = 0; i < adapters.size(); i++)
      {
         ComponentAdapter adapter = (ComponentAdapter)adapters.get(i);
         String workspaceName = new String((String)adapter.getComponentKey());

         try
         {
            if (repositoryContainer.getWorkspaceContainer(workspaceName).getWorkspaceInitializer()
               .isWorkspaceInitialized())
View Full Code Here

   {
   }

   public ComponentAdapter getComponentAdapterOfType(Class componentType)
   {
      ComponentAdapter adapter = adapterByType.get(componentType);
      if (adapter == null)
      {
         adapter = super.getComponentAdapterOfType(componentType);
         if (adapter != null)
         {
View Full Code Here

   //

   public ComponentAdapter registerComponent(ComponentAdapter componentAdapter)
      throws DuplicateComponentKeyRegistrationException
   {
      ComponentAdapter adapter = super.registerComponent(componentAdapter);
      invalidate();
      return adapter;
   }
View Full Code Here

TOP

Related Classes of org.picocontainer.ComponentAdapter$NOTHING

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.