Examples of lookup()


Examples of org.apache.avalon.framework.component.ComponentManager.lookup()

        Connection conn = null;

        try {
            ComponentManager componentManager = (ComponentManager)getMailetContext().getAttribute(Constants.AVALON_COMPONENT_MANAGER);
            // Get the DataSourceSelector service
            DataSourceSelector datasources = (DataSourceSelector)componentManager.lookup(DataSourceSelector.ROLE);
            // Get the data-source required.
            datasource = (DataSourceComponent)datasources.select(datasourceName);

            conn = datasource.getConnection();

Examples of org.apache.avalon.framework.component.DefaultComponentManager.lookup()

        m_componentManager.put(RoleA.ROLE,roleAinParent);
        m_componentManager.put(RoleB.ROLE,roleBinParent);
        DefaultComponentManager baseComponentManager = new DefaultComponentManager(m_componentManager);
        baseComponentManager.put(RoleB.ROLE,roleBinBase);
        Object lookupAinBase = baseComponentManager.lookup(RoleA.ROLE);
        Object lookupBinBase = baseComponentManager.lookup(RoleB.ROLE);
        Object lookupBinParent = m_componentManager.lookup(RoleB.ROLE);
        assertTrue( lookupAinBase instanceof RoleA);
        assertEquals( lookupBinBase, roleBinBase );
        assertEquals( lookupBinParent, roleBinParent );

Examples of org.apache.avalon.framework.service.DefaultServiceManager.lookup()

        m_componentManager.put(RoleA.ROLE,roleAinParent);
        m_componentManager.put(RoleB.ROLE,roleBinParent);
        DefaultServiceManager baseComponentManager = new DefaultServiceManager(m_componentManager);
        baseComponentManager.put(RoleB.ROLE,roleBinBase);
        Object lookupAinBase = baseComponentManager.lookup(RoleA.ROLE);
        Object lookupBinBase = baseComponentManager.lookup(RoleB.ROLE);
        Object lookupBinParent = m_componentManager.lookup(RoleB.ROLE);
        assertTrue( lookupAinBase instanceof RoleA);
        assertEquals( lookupBinBase, roleBinBase );
        assertEquals( lookupBinParent, roleBinParent );

Examples of org.apache.avalon.framework.service.ServiceManager.lookup()

        ServiceSelector selector = null;
        AccessControllerResolver acResolver = null;
        AccessController accessController = null;
        try {

            selector = (ServiceSelector) manager.lookup(AccessControllerResolver.ROLE + "Selector");
            acResolver = (AccessControllerResolver) selector
                    .select(AccessControllerResolver.DEFAULT_RESOLVER);
            accessController = acResolver.resolveAccessController(url);

            PolicyManager policyManager = accessController.getPolicyManager();

Examples of org.apache.axis.utils.AxisClassLoader.lookup()

        String  clsName    = (String) service.getOption( "className" );

        try {
            AxisClassLoader cl     = msgContext.getClassLoader();
            JavaClass       jc     = cl.lookup(clsName);
            Class           cls    = jc.getJavaClass();
           
            if (DEBUG_LOG) {
                System.err.println("Looking up method '" + methodName +
                                   "' in class " + clsName);

Examples of org.apache.axis.utils.cache.ClassCache.lookup()

                                             String clsName)
        throws Exception
    {
        ClassLoader cl     = msgContext.getClassLoader();
        ClassCache cache   = msgContext.getAxisEngine().getClassCache();
        JavaClass  jc      = cache.lookup(clsName, cl);

        return jc.getJavaClass().newInstance();
    }

    /**
 

Examples of org.apache.axis2.util.PolicyLocator.lookup()

        if (key.startsWith("#")) {
          key = key.substring(key.indexOf("#") + 1);
        }

        PolicyLocator locator = new PolicyLocator(axisService);
        Policy p = locator.lookup(key);

        if (p == null) {
          throw new AxisFault("Policy not found for uri : " + key);
        }
        policiesInDescription.put(key, p);

Examples of org.apache.bsf.util.ObjectRegistry.lookup()

     */
    public Object getVariable(String name)
    {
        ObjectRegistry objreg = bsfManager.getObjectRegistry();

        return objreg.lookup(name);
    }

    /*
     * (non-Javadoc)
     * @see xdoclet.templateutil.SubTemplateEngine#setVariable(java.lang.String, java.lang.Object)

Examples of org.apache.camel.spi.ExecutorServiceStrategy.lookup()

        // prefer to use explicit configured executor on the definition
        if (definition.getExecutorService() != null) {
            return definition.getExecutorService();
        } else if (definition.getExecutorServiceRef() != null) {
            ExecutorService answer = strategy.lookup(definition, name, definition.getExecutorServiceRef());
            if (answer == null) {
                throw new IllegalArgumentException("ExecutorServiceRef " + definition.getExecutorServiceRef() + " not found in registry.");
            }
            return answer;
        }

Examples of org.apache.camel.spi.Registry.lookup()

        this(pojo, createParameterMappingStrategy(camelContext));
    }

    public static ParameterMappingStrategy createParameterMappingStrategy(CamelContext camelContext) {
        Registry registry = camelContext.getRegistry();
        ParameterMappingStrategy answer = registry.lookup(ParameterMappingStrategy.class.getName(),
                                                          ParameterMappingStrategy.class);
        if (answer == null) {
            answer = new DefaultParameterMappingStrategy();
        }
        return answer;
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.