Package org.globus.wsrf

Examples of org.globus.wsrf.ResourceException


        final String callerDN = SecurityManager.getManager().getCaller();

        if (callerDN == null) {
            logger.error("REMOVE: no caller identity");
            throw new ResourceException("no caller identity", null);
        }

        final Caller caller = this.baseTranslate.getCaller(callerDN);

        try {
            this.manager.trash(this.id, this.type, caller);
        } catch (DoesNotExistException e) {
            throw new NoSuchResourceException(e.getMessage(), e);
        } catch (ManageException e) {
            if (logger.isDebugEnabled()) {
                logger.error(e.getMessage(), e);
            } else {
                logger.error(e.getMessage());
            }

            throw new ResourceException(e.getMessage(), e);
        }
    }
View Full Code Here


    // -------------------------------------------------------------------------

    protected Resource findSingleton() throws ResourceException {

        if (this.master == null) {
            throw new ResourceException(
                    "StatusHome not initialized properly, no master context");
        }

        // some room for internal IoC in the future
       
        final Manager mgr = this.master.getModuleLocator().getManager();

        final ReprFactory repr =
                this.master.getModuleLocator().getReprFactory();

        final URL baseURL;
        try {
            baseURL = this.master.getBaseURL();
        } catch (IOException e) {
            final String err =
                    "Problem finding base container URL: " + e.getMessage();
            throw new ResourceException(err, e);
        }

        final InstanceTranslate trInstance =
                new InstanceTranslate(repr, baseURL);
View Full Code Here

            }

            return resource;
           
        } catch (ConfigException e) {
            throw new ResourceException(e.getMessage(), e);
        } catch (ManageException e) {
            throw new ResourceException(e.getMessage(), e);
        } catch (DoesNotExistException e) {
            throw new NoSuchResourceException(e.getMessage(), e);
        }
    }
View Full Code Here

            return resource;
           
        } catch (ConfigException e) {
            logger.error(e.getMessage(), e);
            throw new ResourceException(e.getMessage(), e);
        } catch (ManageException e) {
            logger.error(e.getMessage(), e);
            throw new ResourceException(e.getMessage(), e);
        } catch (DoesNotExistException e) {
            throw new NoSuchResourceException(e.getMessage(), e);
        } catch (NoSuchResourceException e) {
            throw e;
        } catch (Throwable t) {
            logger.error(t.getMessage(), t);
            throw new ResourceException(t.getMessage(), t);
        }
    }
View Full Code Here

            }

            return resource;

        } catch (ConfigException e) {
            throw new ResourceException(e.getMessage(), e);
        } catch (ManageException e) {
            throw new ResourceException(e.getMessage(), e);
        } catch (DoesNotExistException e) {
            throw new NoSuchResourceException(e.getMessage(), e);
        }
    }
View Full Code Here

     * @throws ResourceException problem
     */
    public void setRPs(Advertised advert) throws ResourceException {

        if (advert == null) {
            throw new ResourceException("advert may not be missing (yet)");
        }

        this.propSet = new SimpleResourcePropertySet(
                                Constants_GT4_0.FACTORY_RP_SET);

        /* DefaultRunningTime: */
       
        final Integer ttl =
                new Integer(advert.getDefaultRunningTimeSeconds());
        final Duration ttlDur =
                CommonUtil.minutesToDuration(ttl.intValue());
               
        ResourceProperty prop =
                new SimpleResourceProperty(
                        Constants_GT4_0.RP_FACTORY_DefTTL);
        prop.add(ttlDur);
        this.propSet.add(prop);

        /* MaximumRunningTime: */

        final Integer maxttl =
                        new Integer(advert.getMaximumRunningTimeSeconds());
        final Duration maxTtlDur =
                        CommonUtil.minutesToDuration(maxttl.intValue());

        prop = new SimpleResourceProperty(
                        Constants_GT4_0.RP_FACTORY_MaxTTL);
        prop.add(maxTtlDur);
        this.propSet.add(prop);


        /* TODO: NOT an RP yet: MaximumAfterRunningTime */
        //final Integer offset =
        //        new Integer(advert.getMaximumAfterRunningTime());
        //final Duration offsetDur =
        //        CommonUtil.minutesToDuration(offset.intValue());

       
        /* CPUArchitectureName */

        final String[] validArches = advert.getCpuArchitectureNames();
        if (validArches != null && validArches.length > 0) {
            prop = new SimpleResourceProperty(Constants_GT4_0.RP_FACTORY_CPUArch);
            // Can only advertise one of them due to JSDL XSD restrictions.
            prop.add(validArches[0]);
            this.propSet.add(prop);
        }

        if (advert.getVmm() != null) {
            final VMM_Type vmm = new VMM_Type();
            vmm.setType(VMM_TypeType.Xen);
            final String[] versions = advert.getVmmVersions();
            if (versions != null) {
                vmm.setVersion(versions);
            }
            prop = new SimpleResourceProperty(Constants_GT4_0.RP_FACTORY_VMM);
            prop.add(vmm);
            this.propSet.add(prop);
        }

        final String[] assocs;
        try {
            assocs = advert.getNetworkNames();
        } catch (Exception e) {
            throw new ResourceException(e);
        }

        if (assocs != null && assocs.length > 0) {
            final Associations rpAssoc = new Associations(assocs);
            prop = new SimpleResourceProperty(Constants_GT4_0.RP_FACTORY_ASSOCIATIONS);
View Full Code Here

    // -------------------------------------------------------------------------

    protected Resource findSingleton() throws ResourceException {

        if (this.master == null) {
            throw new ResourceException(
                    "FactoryHome not initialized properly, no master context");
        }

        // some room for internal IoC in the future

        final Manager mgr = this.master.getModuleLocator().getManager();

        final ReprFactory repr =
                this.master.getModuleLocator().getReprFactory();

        final MetadataServer mdServer =
                this.master.getModuleLocator().getMetadataServer();

        final URL baseURL;
        try {
            baseURL = this.master.getBaseURL();
        } catch (IOException e) {
            final String err =
                    "Problem finding base container URL: " + e.getMessage();
            throw new ResourceException(err, e);
        }

        final InstanceTranslate trInstance =
                new InstanceTranslate(repr, baseURL);

        final Translate translate =
                            new Translate(repr,
                                          new TranslateDefinitionImpl(repr),
                                          new TranslateRAImpl(repr),
                                          new TranslateNetImpl(repr),
                                          trInstance,
                                          baseURL);

        final ContextBrokerHome brokerHome;
        try {
            brokerHome = OtherContext.discoverContextBrokerHome();
        } catch (Exception e) {
            throw new ResourceException(e.getMessage(), e);
        }

        final FactoryResource resource =
                new FactoryResource(mgr, translate, brokerHome, repr, mdServer);
View Full Code Here

TOP

Related Classes of org.globus.wsrf.ResourceException

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.