Package org.rioproject.deploy

Examples of org.rioproject.deploy.ServiceBeanInstance


        decreaseService.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent ae) {
                try {
                    int planned = sElem.getPlanned();
                    int row = instanceTable.getSelectedRow();
                    ServiceBeanInstance instance =
                        (ServiceBeanInstance)instanceTable.getModel().
                                                           getValueAt(row, 1);
                    opMgr.decrement(instance, true, true);
                    if(planned>0)
                        planned--;
                    sElem.setPlanned(planned);
                    String value = Integer.toString(planned);
                    ServiceAttributeTableItem tableItem =
                        new ServiceAttributeTableItem();
                    tableItem.attributeDescription = new JLabel(value);
                    DefaultTableModel tableModel =
                        (DefaultTableModel)serviceAttributeTable.getModel();
                    tableModel.setValueAt(tableItem,
                                          2,   /*row*/
                                          1)/*column*/
                    ((DefaultTableModel)instanceTable.getModel()).removeRow(row);
                    setInstanceTableLabel(sElem,
                                          (DefaultTableModel)instanceTable.getModel());
                } catch (Exception e) {
                    Util.showError(e, parent, "Unable to decrease instance count");
                }
            }
        });

        /* Relocation instance behavior */
        relocateService.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent ae) {
                try {
                    ServiceBeanInstance instance =
                        (ServiceBeanInstance)instanceTable.getModel().getValueAt(instanceTable.getSelectedRow(), 1);
                    opMgr.relocate(instance, null, null);
                } catch (Exception e) {
                    Util.showError(e, parent, "Unable to relocate");
                }
View Full Code Here


                                   redeployPanel.getClean(),
                                   redeployPanel.getDelay(),
                                   null);

                } else {
                    ServiceBeanInstance instance =
                        (ServiceBeanInstance)instanceTable.getModel().
                                      getValueAt(instanceTable.getSelectedRow(), 1);
                    opMgr.redeploy(null,
                                   instance,
                                   redeployPanel.getClean(),
View Full Code Here

                    }
                    opMgr.doUpdateOperationalString(opString);
                    break;

                case SERVICE_BEAN_INSTANCE_UPDATED:
                    ServiceBeanInstance instance = pme.getServiceBeanInstance();
                    if(instance == null) {
                        peerLogger.debug("ProvisionMonitorPeer: SERVICE_BEAN_INSTANCE_UPDATED instance is null");
                        return;
                    }
                    opStringName = pme.getOperationalStringName();
View Full Code Here

    /**
     * @see org.rioproject.servicebean.ServiceBeanManager#getServiceBeanInstance
     */
    public ServiceBeanInstance getServiceBeanInstance() {
        return(new ServiceBeanInstance(serviceID,
                                       marshalledInstance,
                                       sElem.getServiceBeanConfig(),
                                       hostName,
                                       hostAddress,
                                       cybernodeUuid));
View Full Code Here

     * @throws org.rioproject.deploy.ServiceBeanInstantiationException If the service bean cannot be created
     */
    public Object activate(String classname) throws ServiceBeanInstantiationException {
        if(classname==null)
            throw new IllegalArgumentException("classname must not be null");
        ServiceBeanInstance instance =
            instantiator.activate(makeServiceElement(classname),
                                  null,  // OperationalStringManager
                                  null); // EventHandler (slas)
        ServiceBeanDelegateImpl delegate =
            (ServiceBeanDelegateImpl) instantiator.getServiceBeanDelegate(instance.getServiceBeanID());
        Object impl = delegate.getImpl();
        serviceSet.add(new ActivatedService(impl, delegate.getProxy(), delegate));
        return impl;
    }
View Full Code Here

    private Object instantiateBean(ServiceElement elem) throws ServiceBeanInstantiationException {
        if(elem.forkService())
            throw new ServiceBeanInstantiationException("The StaticCybernode does not " +
                                                        "support the instantiation of a " +
                                                        "service declared to be forked");
        ServiceBeanInstance instance = instantiator.activate(elem,
                                                             null,  // OperationalStringManager
                                                             null); // EventHandler (slas)
        ServiceBeanDelegateImpl delegate = (ServiceBeanDelegateImpl) instantiator.getServiceBeanDelegate(instance.getServiceBeanID());
        Object impl = delegate.getImpl();
        serviceSet.add(new ActivatedService(impl, delegate.getProxy(), delegate));
        return impl;
    }
View Full Code Here

            } catch (RemoteException e) {
                logger.warn("Getting utilization for service [{}], terminating", association.getAssociationDescriptor(), e);
                terminate();
            }
            for(DeployedService deployed : list) {
                ServiceBeanInstance sbi = deployed.getServiceBeanInstance();
                ComputeResourceUtilization cru =
                    deployed.getComputeResourceUtilization();
                for(ServiceCapability sc : services) {
                    if(sc.uuid.equals(sbi.getServiceBeanID())) {
                        logger.trace("Obtained ComputeResourceUtilization for [{}]", association.getName());
                        sc.setComputeResourceUtilization(cru);
                        break;
                    }
                }
View Full Code Here

                        /* Invoke postInitialize lifecycle method if defined
                         * (RIO-141) */
                        BeanHelper.invokeLifeCycle(Initialized.class, "postInitialize", loadResult.getImpl());

                        /* Create the ServiceBeanInstance */
                        instance = new ServiceBeanInstance(serviceID,
                                                           loadResult.getMarshalledInstance(),
                                                           context.getServiceBeanConfig(),
                                                           container.getComputeResource().getHostName(),
                                                           container.getComputeResource().getAddress().getHostAddress(),
                                                           container.getUuid());
View Full Code Here

        synchronized(controllerMap) {
            controllerMap.put(identifier, delegate);
            activationInProcessCount.incrementAndGet();
        }
        boolean started = false;
        ServiceBeanInstance loadedInstance = null;
        try {
            loadedInstance = delegate.load();
            started = true;
            /* notification to shutdown may have come in the middle of
             * service creation, if it did, terminate */
 
View Full Code Here

     */
    public ServiceBeanInstance[] getServiceBeanInstances(ServiceElement element) {
        List<ServiceBeanInstance> list = new ArrayList<ServiceBeanInstance>();
        ServiceBeanDelegate[] delegates = getDelegates(element);
        for (ServiceBeanDelegate delegate : delegates) {
            ServiceBeanInstance instance = delegate.getServiceBeanInstance();
            if (instance != null) {
                list.add(instance);
            }
        }
        return (list.toArray(new ServiceBeanInstance[list.size()]));
View Full Code Here

TOP

Related Classes of org.rioproject.deploy.ServiceBeanInstance

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.