Package org.apache.cocoon.acting

Examples of org.apache.cocoon.acting.Action


        Redirector redirector = context.getRedirector();
        SourceResolver resolver = EnvironmentHelper.getCurrentProcessor().getSourceResolver();

        try {
            Action action = (Action) getComponent();
            Map actionResult;
            try {
                actionResult = this.executor.invokeAction(this,
                                                          objectModel,
                                                          action,
View Full Code Here


    public final Map act(String type, String source, Parameters parameters) throws Exception {
       
        redirector.reset();

        ServiceSelector selector = null;
        Action action = null;
        SourceResolver resolver = null;

        Map result = null;
        try {
            selector = (ServiceSelector) this.lookup(Action.ROLE +
                "Selector");
            assertNotNull("Test lookup of action selector", selector);

            resolver = (SourceResolver) this.lookup(SourceResolver.ROLE);
            assertNotNull("Test lookup of source resolver", resolver);

            assertNotNull("Test if action name is not null", type);
            action = (Action) selector.select(type);
            assertNotNull("Test lookup of action", action);

            result = action.act(redirector, new SourceResolverAdapter(resolver),
                                objectmodel, source, parameters);

        } catch (ServiceException ce) {
            getLogger().error("Could not retrieve action", ce);
            fail("Could not retrieve action: " + ce.toString());
View Full Code Here

        // the one from the environment.
       
        for (int i = 0; i < types.length; i++) {
           
            Map actionResult;
            Action action;
           
            String actionName = actionNames[i];
            if (actionName == null || actionName.equals(cocoonAction)) {
               
                // If action is ThreadSafe, avoid select() and try/catch block (faster !)
                if ((action = this.threadSafeActions[i]) != null) {
                   
                    actionResult = action.act(
                        redirector, resolver, objectModel, source, params);

                } else {
                   
                    action = (Action)this.selector.select(this.componentName);
                    try {
                        actionResult = action.act(
                            redirector, resolver, objectModel, source, params);
                    } finally {
                        this.selector.release(action);
                    }
                }
View Full Code Here

        if (this.threadSafeAction != null) {
            actionResult = this.threadSafeAction.act(
                redirector, resolver, objectModel, resolvedSource, resolvedParams );
           
        } else {
            Action action = (Action)this.selector.select(this.componentName);
            try {
                actionResult = action.act(
                redirector, resolver, objectModel, resolvedSource, resolvedParams );
               
            } finally {
                this.selector.release(action);
            }
View Full Code Here

        SourceResolver resolver = (SourceResolver)this.environment.getObjectModel()
            .get(OBJECT_SOURCE_RESOLVER);
        ComponentManager sitemapManager = CocoonComponentManager.getSitemapComponentManager();
        ComponentSelector actionSelector
            = (ComponentSelector)sitemapManager.lookup(Action.ROLE + "Selector");
        Action action = (Action)actionSelector.select(type);
        Map result = null;
        try {
            result = action.act(redirector,
                                resolver,
                                this.environment.getObjectModel(),
                                source,
                                jsobjectToParameters(parameters));
        } finally {
View Full Code Here

        // If action is ThreadSafe, avoid select() and try/catch block (faster !)
        if (this.threadSafeAction != null) {
            actionResult = this.threadSafeAction.act(
                redirector, resolver, objectModel, resolvedSource, resolvedParams);
        } else {
            Action action = (Action)this.selector.select(this.componentName);
            try {
                actionResult = action.act(
                redirector, resolver, objectModel, resolvedSource, resolvedParams);

            } finally {
                this.selector.release(action);
            }
View Full Code Here

        if (this.threadSafeAction != null) {
            actionResult = this.threadSafeAction.act(
                redirector, resolver, objectModel, resolvedSource, resolvedParams );

        } else {
            Action action = (Action)this.selector.select(this.componentName);
            try {
                actionResult = action.act(
                redirector, resolver, objectModel, resolvedSource, resolvedParams );

            } finally {
                this.selector.release(action);
            }
View Full Code Here

        // the one from the environment.

        for (int i = 0; i < types.length; i++) {

            Map actionResult;
            Action action;

            String actionName = actionNames[i];
            String source = sources[i].resolve(context, objectModel);
            if (actionName == null || actionName.equals(cocoonAction)) {

                Parameters actionParams = VariableResolver.buildParameters(parameters[i], context, objectModel);
                if (actionParams == Parameters.EMPTY_PARAMETERS) {
                    actionParams = params;
                } else {
                    actionParams.merge(params);
                }

                // If action is ThreadSafe, avoid select() and try/catch block (faster !)
                if ((action = this.threadSafeActions[i]) != null) {

                    actionResult = action.act(
                        redirector, resolver, objectModel, source, actionParams);

                } else {

                    action = (Action)this.selector.select(this.types[i]);
                    try {
                        actionResult = action.act(
                            redirector, resolver, objectModel, source, actionParams);
                    } finally {
                        this.selector.release(action);
                    }
                }
View Full Code Here

    public final Map act(String type, String source, Parameters parameters) throws Exception {
       
        redirector.reset();

        ServiceSelector selector = null;
        Action action = null;
        SourceResolver resolver = null;

        Map result = null;
        try {
            selector = (ServiceSelector) this.lookup(Action.ROLE +
                "Selector");
            assertNotNull("Test lookup of action selector", selector);

            resolver = (SourceResolver) this.lookup(SourceResolver.ROLE);
            assertNotNull("Test lookup of source resolver", resolver);

            assertNotNull("Test if action name is not null", type);
            action = (Action) selector.select(type);
            assertNotNull("Test lookup of action", action);

            result = action.act(redirector, new SourceResolverAdapter(resolver),
                                objectmodel, source, parameters);

        } catch (ServiceException ce) {
            getLogger().error("Could not retrieve action", ce);
            fail("Could not retrieve action: " + ce.toString());
View Full Code Here

        // If action is ThreadSafe, avoid select() and try/catch block (faster !)
        if (this.threadSafeAction != null) {
            actionResult = this.threadSafeAction.act(redirector, resolver,
                    objectModel, resolvedSource, resolvedParams);
        } else {
            Action action = (Action)this.selector.select(this.componentName);
            try {
                actionResult = action.act(redirector, resolver,
                        objectModel, resolvedSource, resolvedParams);
            } finally {
                this.selector.release(action);
            }
        }
View Full Code Here

TOP

Related Classes of org.apache.cocoon.acting.Action

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.