Package org.rioproject.servicebean

Examples of org.rioproject.servicebean.ServiceBeanManagerException


        }

        try {
            opStringManager.update(getServiceBeanInstance());
        } catch (OperationalStringException e) {
            throw new ServiceBeanManagerException("Unable to update ServiceBeanConfig", e);
        } catch (RemoteException e) {
            throw new ServiceBeanManagerException("Problem communicating to OperationalStringManager, " +
                                                  "unable to update ServiceBeanConfig", e);
        }
        stateChange(preElem, sElem);
    }
View Full Code Here


    /**
     * @see org.rioproject.servicebean.ServiceBeanManager#increment
     */
    public void increment(final ServiceProvisionListener listener) throws ServiceBeanManagerException {
        if(opStringManager==null) {
            throw new ServiceBeanManagerException("No OperationalStringManager to increment service");
        }
        try {
            opStringManager.increment(sElem, false, listener);
        } catch (OperationalStringException e) {
            throw new ServiceBeanManagerException("Unable to increment", e);
        } catch (RemoteException e) {
            throw new ServiceBeanManagerException("Problem communicating to OperationalStringManager, unable to increment", e);
        }
    }
View Full Code Here

    /**
     * @see org.rioproject.servicebean.ServiceBeanManager#decrement
     */
    public void decrement(final boolean destroy) throws ServiceBeanManagerException {
        if(opStringManager==null) {
            throw new ServiceBeanManagerException("No OperationalStringManager to decrement service");
        }
        try {
            opStringManager.decrement(getServiceBeanInstance(), false, destroy);
        } catch (OperationalStringException e) {
            e.printStackTrace();
        } catch (RemoteException e) {
            throw new ServiceBeanManagerException("Problem communicating to OperationalStringManager, unable to decrement", e);
        }
    }   
View Full Code Here

    /**
     * @see org.rioproject.servicebean.ServiceBeanManager#relocate
     */
    public void relocate(final ServiceProvisionListener listener, final Uuid uuid) throws ServiceBeanManagerException {
        if(opStringManager==null) {
            throw new ServiceBeanManagerException("No OperationalStringManager to relocate service");
        }
        if(sElem.getProvisionType()!= ServiceElement.ProvisionType.DYNAMIC)
            throw new ServiceBeanManagerException("Relocation only available for DYNAMIC services");
        try {
            opStringManager.relocate(getServiceBeanInstance(), listener, uuid);
        } catch (OperationalStringException e) {
            throw new ServiceBeanManagerException("Unable to relocate ServiceBeanConfig", e);
        } catch (RemoteException e) {
            throw new ServiceBeanManagerException("Problem communicating to OperationalStringManager, unable to relocate", e);
        }
    }
View Full Code Here

    /**
     * @see org.rioproject.servicebean.ServiceBeanManager#getServiceBeanControl()
     */
    public ServiceBeanControl getServiceBeanControl() throws ServiceBeanManagerException {
        if(marshalledInstance==null)
            throw new ServiceBeanManagerException("Unable to obtain ServiceBeanControl, there is no marshalled proxy instance");
        ServiceBeanControl serviceBeanControl;
        try {
            Object proxy = marshalledInstance.get(false);
            if(proxy instanceof Administrable) {
                Object adminObject = ((Administrable)proxy).getAdmin();
                if(adminObject instanceof ServiceBeanControl) {
                    serviceBeanControl = (ServiceBeanControl)proxy;
                } else {
                    throw new ServiceBeanManagerException(String.format("Service is not an instanceof %s",
                                                          ServiceBeanControl.class.getName()));
                }
            } else {
                throw new ServiceBeanManagerException(String.format("%s is derivable from %s, however, the service proxy does not implement %s",
                                                                    ServiceBeanControl.class.getName(),
                                                                    Administrable.class.getName(),
                                                                    Administrable.class.getName()));
            }
        } catch (Exception e) {
            throw new ServiceBeanManagerException("Unable to obtain ServiceBeanControl", e);
        }
        return serviceBeanControl;
    }
View Full Code Here

TOP

Related Classes of org.rioproject.servicebean.ServiceBeanManagerException

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.