Package org.apache.avalon.framework.service

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();
View Full Code Here


        WebContinuation wk;
        Scriptable scope = getTopLevelScope(c);
        FOM_Cocoon cocoon = (FOM_Cocoon)getProperty(scope, "cocoon");
        ServiceManager componentManager =  cocoon.getServiceManager();
        ContinuationsManager contMgr = (ContinuationsManager)
            componentManager.lookup(ContinuationsManager.ROLE);
        wk = contMgr.createWebContinuation(c,
                                           (parent == null ? null : parent.getWebContinuation()),
                                           timeToLive,
                                           cocoon.getInterpreterId(),
                                           null);
View Full Code Here

        ContinuationsManager contMgr = null;
        FOM_Cocoon cocoon =
            (FOM_Cocoon)getProperty(getTopLevelScope(this), "cocoon");
        ServiceManager componentManager = cocoon.getServiceManager();
        contMgr = (ContinuationsManager)
            componentManager.lookup(ContinuationsManager.ROLE);
        contMgr.invalidateWebContinuation(wk);
    }

    public void jsFunction_display() {
        wk.display();
View Full Code Here

            DocumentFragment domTemplate = null;

            String src = bindingElm.getAttribute("src");
            if (!src.equals("")) {
                ServiceManager manager = assistant.getServiceManager();
                SourceResolver sourceResolver = (SourceResolver)manager.lookup(SourceResolver.ROLE);
                Source source = null;
                try {
                    source = sourceResolver.resolveURI(src);
                    Document document = SourceUtil.toDOM(source);
                    Element element = document.getDocumentElement();
View Full Code Here

                    Document document = SourceUtil.toDOM(source);
                    Element element = document.getDocumentElement();

                    String xpath = bindingElm.getAttribute("xpath");
                    if (!xpath.equals("")) {
                        XPathProcessor xpathProcessor = (XPathProcessor)manager.lookup(XPathProcessor.ROLE);
                        try {
                            Node node = xpathProcessor.selectSingleNode(document, xpath);
                            if (node == null)
                                throw new BindingException("XPath expression \"" + xpath + "\" didn't return a result.");
                            if (!(node instanceof Element))
View Full Code Here

        ServiceSelector serializerSelector = null;
        Serializer serializer = null;
        // this.manager does not have Serializer
        try {
            manager = (ServiceManager) this.context.get(ContextHelper.CONTEXT_SITEMAP_SERVICE_MANAGER);
            serializerSelector = (ServiceSelector) manager.lookup(Serializer.ROLE + "Selector");
            serializer = (Serializer)serializerSelector.select("xml");
            ByteArrayOutputStream os = new ByteArrayOutputStream();
            serializer.setOutputStream(os);

            toSAX(serializer);
View Full Code Here

        customSpringService = (CustomSpringService) ctx.getBean("customSpringService");
        customSpringService.sayGretting();
        assertEquals(customSpringService.getGreeting(), GREETING);

        // lookup and use the Spring bean using Avalon's Service Manager
        customSpringService = (CustomSpringService) serviceManager.lookup("customSpringService");
        customSpringService.sayGretting();
        assertEquals(customSpringService.getGreeting(), GREETING);

        // lookup and use the Avalon service using Spring's context
        customAvalonService = (CustomAvalonService) ctx.getBean("customAvalonService");
View Full Code Here

        customAvalonService = (CustomAvalonService) ctx.getBean("customAvalonService");
        customAvalonService.sayGretting();
        assertEquals(customAvalonService.getGreeting(), GREETING);
       
        // lookup and use the Avalon service using Avalon's Service Manager
        customAvalonService = (CustomAvalonService) serviceManager.lookup("customAvalonService");
        customAvalonService.sayGretting();
        assertEquals(customAvalonService.getGreeting(), GREETING);

        // try to find a non-existing service using Avalon's Service Manager
        try
View Full Code Here

        assertEquals(customAvalonService.getGreeting(), GREETING);

        // try to find a non-existing service using Avalon's Service Manager
        try
        {
            serviceManager.lookup("foo");
            fail("Looking up a non-existing service must throw a ServiceException");
        }
        catch(ServiceException e)
        {
            // nothing to do
View Full Code Here

        customSpringService = (CustomSpringService) ctx.getBean("customSpringService");
        customSpringService.sayGretting();
        assertEquals(customSpringService.getGreeting(), GREETING);

        // lookup and use the Spring bean using Avalon's Service Manager
        customSpringService = (CustomSpringService) serviceManager.lookup("customSpringService");
        customSpringService.sayGretting();
        assertEquals(customSpringService.getGreeting(), GREETING);

        // lookup and use the Avalon service using Spring's context
        customAvalonService = (CustomAvalonService) ctx.getBean("customAvalonService");
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.