Examples of CustomAction


Examples of org.apache.commons.scxml.model.CustomAction

        // Create a list of the custom Commons SCXML actions defined by the
        // Shale dialog Commons SCXML implementation
        List shaleDialogActions = new ArrayList();

        // <shale:redirect>
        CustomAction redirectAction =
            new CustomAction(Globals.CUSTOM_SCXML_ACTIONS_URI,
                "redirect", RedirectAction.class);
        shaleDialogActions.add(redirectAction);

        // <shale:view>
        CustomAction viewAction =
            new CustomAction(Globals.CUSTOM_SCXML_ACTIONS_URI,
                "view", ViewAction.class);
        shaleDialogActions.add(viewAction);

        // Class loader for app developer defined custom Commons SCXML actions
        ClassLoader loader = Thread.currentThread().getContextClassLoader();
        if (loader == null) {
            loader = ConfigurationParser.class.getClassLoader();
        }

        while (iterator.hasNext()) {

                Map.Entry entry = (Map.Entry) iterator.next();
                String name = (String) entry.getKey();
                DialogMetadata dMetadata = (DialogMetadata) entry.getValue();
                String scxmlconfig = dMetadata.getScxmlconfig();

                // The custom actions available to this dialog is the
                // summation of the ones defined by this Shale dialog module
                // and those defined by the app developer using the dialog
                // configuration file for this dialog
                List customDialogActions = new ArrayList();
                customDialogActions.addAll(shaleDialogActions);

                List devActions = dMetadata.getDialogActions();
                for (int i = 0; i < devActions.size(); i++) {
                    SCXMLAction scxmlAction = (SCXMLAction) devActions.get(i);
                    String actionname = scxmlAction.getName();
                    String uri = scxmlAction.getUri();
                    String actionFQCN = scxmlAction.getActionclassname();
                    if (actionname == null || uri == null || actionFQCN == null) {
                        // shouldn't happen if dialog-config is validated
                        throw new IllegalArgumentException("A custom Commons"
                            + " SCXML action (<scxmlaction> element) in the"
                            + " dialog configuration is missing the 'name',"
                            + " 'uri' or 'actionclassname'");
                    }
                    Class customActionClass = null;
                    try {
                        customActionClass = loader.loadClass(actionFQCN);
                    } catch (Exception e) {
                        throw new IllegalArgumentException("Cannot load "
                            + "custom Commons SCXML action class '"
                            + actionFQCN + "' for action with name '"
                            + actionname + "'");
                    }
                    CustomAction customAction = new CustomAction(uri,
                        actionname, customActionClass);
                    customDialogActions.add(customAction);
                }

                URL resource = new URL(getResource(), scxmlconfig);
View Full Code Here

Examples of org.apache.commons.scxml2.model.CustomAction

                            readVar(reader, configuration, executable, parent);
                        } else {
                            reportIgnoredElement(reader, configuration, end, nsURI, name);
                        }
                    } else { // custom action
                        CustomAction customAction = null;
                        if (!configuration.customActions.isEmpty()) {
                            for (CustomAction ca : configuration.customActions) {
                                if (ca.getNamespaceURI().equals(nsURI) && ca.getLocalName().equals(name)) {
                                    customAction = ca;
                                }
View Full Code Here

Examples of org.eclipse.graphiti.ui.internal.action.CustomAction

    String text = cmEntry.getText();
    IContextMenuEntry[] children = cmEntry.getChildren();
    if (children.length == 0) {
      IFeature feature = cmEntry.getFeature();
      if (feature instanceof ICustomFeature && feature.isAvailable(context)) {
        IAction action = new CustomAction((ICustomFeature) feature, context, getBehavior());
        if (textParentEntry != null) {
          text = textParentEntry + " " + text; //$NON-NLS-1$
        }
        action.setText(text);
        action.setDescription(cmEntry.getDescription());
        ImageDescriptor image = Activator.getDefault().getImageDescriptor(cmEntry.getIconId());
        action.setImageDescriptor(image);
        appendContributionItem(manager, groupID, new ActionContributionItem(action));
      }
    } else {
      if (cmEntry.isSubmenu()) {
View Full Code Here

Examples of org.jmock.lib.action.CustomAction

            allowing (managementContext).registerMBean(with(any(Object.class)), with(equal(           
                    new ObjectName("Test:BrokerName=BrokerNC,Type=jobScheduler,jobSchedulerName=JMS"))));
           
            atLeast(maxReconnects - 1).of (managementContext).registerMBean(with(any(Object.class)), with(new NetworkBridgeObjectNameMatcher<ObjectName>(
                        new ObjectName("Test:BrokerName=BrokerNC,Type=NetworkBridge,NetworkConnectorName=NC,Name=localhost/127.0.0.1_"
                            + proxy.getUrl().getPort())))); will(new CustomAction("signal register network mbean") {
                                public Object invoke(Invocation invocation) throws Throwable {
                                    LOG.info("Mbean Registered: " + invocation.getParameter(0));
                                    mbeanRegistered.release();
                                    return new ObjectInstance((ObjectName)invocation.getParameter(1), "dscription");
                                }
                            });
            atLeast(maxReconnects - 1).of (managementContext).unregisterMBean(with(new NetworkBridgeObjectNameMatcher<ObjectName>(
                    new ObjectName("Test:BrokerName=BrokerNC,Type=NetworkBridge,NetworkConnectorName=NC,Name=localhost/127.0.0.1_"
                            + proxy.getUrl().getPort())))); will(new CustomAction("signal unregister network mbean") {
                                public Object invoke(Invocation invocation) throws Throwable {
                                    LOG.info("Mbean Unregistered: " + invocation.getParameter(0));
                                    mbeanUnregistered.release();
                                    return null;
                                }
View Full Code Here

Examples of org.jmock.lib.action.CustomAction

            allowing (managementContext).registerMBean(with(any(Object.class)), with(equal(           
                    new ObjectName("Test:BrokerName=BrokerNC,Type=jobScheduler,jobSchedulerName=JMS"))));
           
            atLeast(maxReconnects - 1).of (managementContext).registerMBean(with(any(Object.class)), with(new NetworkBridgeObjectNameMatcher<ObjectName>(
                        new ObjectName("Test:BrokerName=BrokerNC,Type=NetworkBridge,NetworkConnectorName=NC,Name=localhost/127.0.0.1_"
                            + proxy.getUrl().getPort())))); will(new CustomAction("signal register network mbean") {
                                public Object invoke(Invocation invocation) throws Throwable {
                                    LOG.info("Mbean Registered: " + invocation.getParameter(0));
                                    mbeanRegistered.release();
                                    return new ObjectInstance((ObjectName)invocation.getParameter(0), "dscription");
                                }
                            });
            atLeast(maxReconnects - 1).of (managementContext).unregisterMBean(with(new NetworkBridgeObjectNameMatcher<ObjectName>(
                    new ObjectName("Test:BrokerName=BrokerNC,Type=NetworkBridge,NetworkConnectorName=NC,Name=localhost/127.0.0.1_"
                            + proxy.getUrl().getPort())))); will(new CustomAction("signal unregister network mbean") {
                                public Object invoke(Invocation invocation) throws Throwable {
                                    LOG.info("Mbean Unregistered: " + invocation.getParameter(0));
                                    mbeanUnregistered.release();
                                    return null;
                                }
View Full Code Here

Examples of org.jmock.lib.action.CustomAction

    private void setupFakeJndiLookup() throws NamingException {
        CONTEXT_MOCK_FOR_TEST = context.mock(Context.class);

        context.checking(new Expectations() {{
            allowing(CONTEXT_MOCK_FOR_TEST).lookup(with(any(String.class)));
                will(new CustomAction("Fake JNDI lookup") {

                    @Override
                    public Object invoke(Invocation invocation) throws Throwable {
                        // JNDI name format like: java:global/rhq/rhq-server/SystemManagerBean!org.rhq.enterprise.server.system.SystemManagerLocal
                        String jndiName = (String) invocation.getParameter(0);
View Full Code Here

Examples of org.jmock.lib.action.CustomAction

    public synchronized CustomAction mergeInventoryReport(final InventoryStatus requiredInventoryStatus) {
        return mergeInventoryReport(getSimpleJudge(requiredInventoryStatus));
    }

    public synchronized CustomAction mergeInventoryReport(final InventoryStatusJudge judge) {
        return new CustomAction("updateServerSideInventory") {
            public Object invoke(Invocation invocation) throws Throwable {
                synchronized (FakeServerInventory.this) {
                    throwIfFailing();

                    InventoryReport inventoryReport = (InventoryReport) invocation.getParameter(0);
View Full Code Here

Examples of org.jmock.lib.action.CustomAction

            }
        };
    }

    public synchronized CustomAction getResourceSyncInfo() {
        return new CustomAction("getResourceSyncInfo") {
            public Object invoke(Invocation invocation) throws Throwable {
                synchronized (FakeServerInventory.this) {
                    throwIfFailing();

                    Integer resourceId = (Integer) invocation.getParameter(0);
View Full Code Here

Examples of org.jmock.lib.action.CustomAction

            }
        };
    }

    public synchronized CustomAction clearPlatform() {
        return new CustomAction("updateServerSideInventory - report platform deleted on the server") {
            public Object invoke(Invocation invocation) throws Throwable {
                synchronized (FakeServerInventory.this) {
                    throwIfFailing();

                    platform = null;
View Full Code Here

Examples of org.jmock.lib.action.CustomAction

            }
        };
    }

    public synchronized CustomAction setResourceError() {
        return new CustomAction("setResourceError") {
            public Object invoke(Invocation invocation) throws Throwable {
                synchronized (FakeServerInventory.this) {
                    throwIfFailing();

                    ResourceError error = (ResourceError) invocation.getParameter(0);
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.