Package net.jini.admin

Examples of net.jini.admin.Administrable


            int answer = JOptionPane.showConfirmDialog(
                component, message, title,
                JOptionPane.YES_NO_OPTION);
            if (answer == JOptionPane.NO_OPTION)
                return;
            Administrable admin = (Administrable) this.item.service;
            DestroyAdmin destroyAdmin = (DestroyAdmin) admin.getAdmin();
            destroyAdmin.destroy();
            if (component != null) {
                Util.dispose(component);
            }
        } catch (Exception e) {
View Full Code Here


                                                                                            "adminProxyPreparer",
                                                                                            BasicProxyPreparer.class,
                                                                                            new BasicProxyPreparer());
                    Object preparedPProxy = prep.prepareProxy(sbProxy);
                    if(preparedPProxy instanceof Administrable) {
                        Administrable admin = (Administrable)preparedPProxy;
                        Object adminObject = admin.getAdmin();
                        if(adminObject instanceof DestroyAdmin) {
                            Subject subject = null;
                            if(context instanceof DefaultServiceBeanContext)
                                subject = ((DefaultServiceBeanContext)context).getSubject();
                            registrationMap.put((DestroyAdmin)adminObject, subject);
View Full Code Here

     *
     * @return True if the service is destroyed
     */
    void doDestroyService(final Object service, final Uuid serviceUuid, boolean clean) throws RemoteException {
        logger.trace("Obtaining DestroyAdmin for [{}]", LoggingUtil.getLoggingName(svcElement));
        Administrable admin = (Administrable)service;
        DestroyAdmin destroyAdmin = (DestroyAdmin)admin.getAdmin();
        logger.trace("DestroyAdmin obtained, destroy the service [{}]", LoggingUtil.getLoggingName(svcElement));
        destroyAdmin.destroy();
        logger.trace("The service [{}] has been destroyed", LoggingUtil.getLoggingName(svcElement));
    }
View Full Code Here

         *
         * @param jsbInstance The ServiceBeanInstance
         */
        public void succeeded(final ServiceBeanInstance jsbInstance) throws RemoteException {
            try {
                Administrable admin = (Administrable)original.getService();
                DestroyAdmin destroyAdmin = (DestroyAdmin)admin.getAdmin();
                destroyAdmin.destroy();
            } catch(Exception e) {
                if(mgrLogger.isTraceEnabled()) {
                    mgrLogger.trace("[{}] Destroying original service", LoggingUtil.getLoggingName(svcElement), e);
                } else {
View Full Code Here

        ClassLoader currentClassLoader = currentThread.getContextClassLoader();
        try {
            ClassLoader proxyCL = serviceProxy.getClass().getClassLoader();
            currentThread.setContextClassLoader(proxyCL);
            if (serviceProxy instanceof Administrable) {
                Administrable admin = (Administrable) serviceProxy;
                Object adminObject = admin.getAdmin();

                if (adminObject instanceof ServiceBeanControl) {
                    ServiceBeanControl controller = (ServiceBeanControl) adminObject;
                    controller.advertise();
                    /* Additional attributes are ignored here, they are obtained
View Full Code Here

                Object service = instance.getService();
                //check name
                if (aHandler.associationDescriptor.matchOnName()) {
                    boolean hailMaryCheck = false;
                    if (service instanceof Administrable) {
                        Administrable admin = (Administrable) service;
                        Object adminObject = admin.getAdmin();
                        if (adminObject instanceof JoinAdmin) {
                            JoinAdmin joinAdmin = (JoinAdmin) adminObject;
                            Entry[] attrs = joinAdmin.getLookupAttributes();
                            boolean matched = false;
                            for (Entry attr : attrs) {
View Full Code Here

            /* If we have an instance, go through service termination */
            if(instance!=null) {
                if(serviceProxy!=null) {
                    try {
                        if(serviceProxy instanceof Administrable) {
                            Administrable admin = (Administrable)serviceProxy;
                            Object adminObject = admin.getAdmin();

                            if(adminObject instanceof DestroyAdmin) {
                                DestroyAdmin destroyAdmin = (DestroyAdmin)adminObject;
                                destroyAdmin.destroy();
                                setDiscarded();
View Full Code Here

        boolean hasDifferentLocators = ServiceElementUtil.hasDifferentLocators(preElem, postElem);
        if (hasDifferentGroups || hasDifferentLocators) {
            logger.trace("[{}] Discovery has changed", context.getServiceElement().getName());
            if (serviceProxy instanceof Administrable) {
                try {
                    Administrable admin = (Administrable) serviceProxy;
                    Object adminObject;
                    adminObject = admin.getAdmin();
                    if (adminObject instanceof JoinAdmin) {
                        JoinAdmin joinAdmin = (JoinAdmin) adminObject;
                        /* Update groups if they have changed */
                        if (hasDifferentGroups) {
                            joinAdmin.setLookupGroups(postElem.getServiceBeanConfig().getGroups());
View Full Code Here

                                               Action.REDEPLOY_FAILURE.name()));
            if(!e.isManaged()) {
                logger.warn("Attempt to redeploy service [{}] failed, it is not under management control. Terminating the service.",
                            context.getServiceElement().getName());
                try {
                    Administrable admin =
                        (Administrable)mgr.getServiceBeanInstance().getService();
                    DestroyAdmin dAdmin = (DestroyAdmin) admin.getAdmin();
                    dAdmin.destroy();
                } catch(Exception ex) {
                    logger.error("Unable to destroy service ["+context.getServiceElement().getName()+"] ", ex);
                }
            } else {
View Full Code Here

TOP

Related Classes of net.jini.admin.Administrable

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.