Package org.nimbustools.messaging.gt4_0.factory

Examples of org.nimbustools.messaging.gt4_0.factory.Translate


            logger.fatal(t.getMessage(), t);
            throw InstanceUtil.makeShutdownFault(
                    FaultUtil.unknown(t, "group.shutdown"), null);
        }

        return new VoidType();
    }
View Full Code Here


        this.validateAll();

        try {

            ((WorkspacePortType) this.portType).start(new VoidType());

        } catch (WorkspaceUnknownFault e) {
            throw e;
        } catch (WorkspaceStartFault e) {
            throw e;
View Full Code Here

                               WorkspaceUnknownFault {

        this.validateAll();

        try {
            ((WorkspaceGroupPortType) this.portType).start(new VoidType());
           
        } catch (WorkspaceUnknownFault e) {
            throw e;
        } catch (WorkspaceStartFault e) {
            throw e;
View Full Code Here

                                     WorkspaceMetadataFault,
                                     WorkspaceEnsembleFault,
                                     WorkspaceContextualizationFault,
                                     ExecutionProblem {

        final WorkspaceCreateRequest_Type createRequest =
                                            new WorkspaceCreateRequest_Type();

        this.populateCreateRequest(createRequest);

        /* CREATE */

        final WorkspaceCreateResponse_Type response;
        try {
            response = ((WorkspaceFactoryPortType)this.portType).
                                                        create(createRequest);
        } catch (WorkspaceCreationFault e) {
            throw e;
        } catch (WorkspaceResourceRequestDeniedFault e) {
            throw e;
        } catch (WorkspaceSchedulingFault e) {
            throw e;
        } catch (WorkspaceMetadataFault e) {
            throw e;
        } catch (WorkspaceEnsembleFault e) {
            throw e;
        } catch (WorkspaceContextualizationFault e) {
            throw e;
        } catch (RemoteException e) {
            throw RMIUtils.generalRemoteException(e);
        }

        /* CHECK GENERAL ASSUMPTIONS */

        // the "(?)" symbol is a shorthand for "very unexpected"...

        if (response == null) {
            throw new ExecutionProblem("(?) null response");
        }

        final CreatedWorkspace_Type[] allrefs = response.getCreatedWorkspace();
        if (allrefs == null) {
            throw new ExecutionProblem(
                    "(?) null references in factory response");
        }

        /* CHECK NODE-NUMBER RELATED ASSUMPTIONS */

        final int expectedNodeNum =
                createRequest.getResourceRequest().getNodeNumber();

        if (expectedNodeNum == 1) {
            if (response.getGroupEPR() != null) {
                throw new ExecutionProblem("(?) group EPR assigned but " +
                        "this was not a group request");
View Full Code Here

        if (result == null) {
            throw new IllegalArgumentException("result may not be null");
        }

        final WorkspaceCreateResponse_Type response =
                            new WorkspaceCreateResponse_Type();

        response.setCreatedWorkspace(
                this.getCreatedWorkspaces(result.getVMs()));

        final String groupID = result.getGroupID();
        if (groupID != null) {
            response.setGroupEPR(this.groupEPRs.getEPR(groupID));
        }

        final String coschedID = result.getCoscheduledID();
        if (coschedID != null) {
            response.setEnsembleEPR(this.ensembleEPRs.getEPR(coschedID));
        }

        if (ctxEPR != null) {
            response.setContextEPR(ctxEPR);
        }

        return response;
    }
View Full Code Here

                logger.error("", e);
                throw FactoryUtil.makeCreationFault("", e);
            }
        }

        final WorkspaceCreateResponse_Type resp;
        try {
            resp = this.resource.create(createRequest, callerDN);
        } catch (Exception e) {

            final String err =
View Full Code Here

                                     WorkspaceEnsembleFault,
                                     WorkspaceContextualizationFault,
                                     WorkspaceCreationFault {
       
        this.validateAll();
        final WorkspaceCreateResponse_Type response = this.createImpl();
        return this.handleInstanceCreation(response);
    }
View Full Code Here

        this.populateCreateRequest(createRequest);

        /* CREATE */

        final WorkspaceCreateResponse_Type response;
        try {
            response = ((WorkspaceFactoryPortType)this.portType).
                                                        create(createRequest);
        } catch (WorkspaceCreationFault e) {
            throw e;
        } catch (WorkspaceResourceRequestDeniedFault e) {
            throw e;
        } catch (WorkspaceSchedulingFault e) {
            throw e;
        } catch (WorkspaceMetadataFault e) {
            throw e;
        } catch (WorkspaceEnsembleFault e) {
            throw e;
        } catch (WorkspaceContextualizationFault e) {
            throw e;
        } catch (RemoteException e) {
            throw RMIUtils.generalRemoteException(e);
        }

        /* CHECK GENERAL ASSUMPTIONS */

        // the "(?)" symbol is a shorthand for "very unexpected"...

        if (response == null) {
            throw new ExecutionProblem("(?) null response");
        }

        final CreatedWorkspace_Type[] allrefs = response.getCreatedWorkspace();
        if (allrefs == null) {
            throw new ExecutionProblem(
                    "(?) null references in factory response");
        }

        /* CHECK NODE-NUMBER RELATED ASSUMPTIONS */

        final int expectedNodeNum =
                createRequest.getResourceRequest().getNodeNumber();

        if (expectedNodeNum == 1) {
            if (response.getGroupEPR() != null) {
                throw new ExecutionProblem("(?) group EPR assigned but " +
                        "this was not a group request");
            }
        } else {
            if (response.getGroupEPR() == null) {
                throw new ExecutionProblem("(?) group EPR was not assigned " +
                        "but this was a group request");
            }
        }

        if (allrefs.length != expectedNodeNum) {
            throw new ExecutionProblem("(?) expecting " + expectedNodeNum +
                  "CreatedWorkspace reference(s), received " + allrefs.length);
        }


        /* CHECK ENSEMBLE RELATED ASSUMPTIONS */

        final EndpointReferenceType ensembleEPR = response.getEnsembleEPR();

        if (this.expectEnsembleEPR && ensembleEPR == null) {
            throw new ExecutionProblem("(?) requested ensemble " +
                    "participation but no ensemble EPR was assigned");
        }

        if (!this.expectEnsembleEPR && ensembleEPR != null) {
            throw new ExecutionProblem("(?) ensemble EPR assigned but " +
                    "no request was made for ensemble participation");
        }

        /* CHECK CONTEXT RELATED ASSUMPTIONS */

        final EndpointReferenceType contextEPR = response.getContextEPR();

        if (this.expectContextEPR && contextEPR == null) {
            throw new ExecutionProblem("(?) requested context " +
                    "participation but no context EPR was assigned");
        }
View Full Code Here

                                      WorkspaceEnsembleFault,
                                      WorkspaceContextualizationFault,
                                      WorkspaceCreationFault {

        this.validateAll();
        final WorkspaceCreateResponse_Type response = this.createImpl();
        return this.handleGroupCreation(response);
    }
View Full Code Here

        }

        State ret = null;
        if (testValidState(val.getValue())) {
            ret = new State(val.getValue());
            final WorkspaceFault fault = curr.getWorkspaceFault();
            if (fault != null) {
                ret.setProblem(fault);
            }
        }
       
View Full Code Here

TOP

Related Classes of org.nimbustools.messaging.gt4_0.factory.Translate

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.