Examples of DestroyAdmin


Examples of com.sun.jini.admin.DestroyAdmin

     */
    static int destroy(Object service) throws RemoteException {
        /* First, test that the service implements both of the appropriate
         * administration interfaces
         */
        DestroyAdmin destroyAdmin = null;
        if( !(service instanceof Administrable) ) {
            return SERVICE_NOT_ADMINISTRABLE;
        }
        Object admin = ((Administrable)service).getAdmin();
        if( !(admin instanceof DestroyAdmin) ) {
            return SERVICE_NOT_DESTROY_ADMIN;
        }
        destroyAdmin = (DestroyAdmin)admin;
        destroyAdmin.destroy();
        return DESTROY_SUCCESS;
    }
View Full Code Here

Examples of com.sun.jini.admin.DestroyAdmin

    public void run() throws Exception {
  logger.log(Level.INFO, "Starting up " + this.getClass().toString());

  PullEventMailbox mb = getPullMailbox();
  Object admin = getMailboxAdmin(mb);
        DestroyAdmin dAdmin = (DestroyAdmin)admin;
        int i = 0;

  // Register and check lease
  MailboxPullRegistration mr = getPullRegistration(mb, DURATION1);
  Lease mrl = getPullMailboxLease(mr);
View Full Code Here

Examples of com.sun.jini.admin.DestroyAdmin

                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) {
            e.printStackTrace();
View Full Code Here

Examples of com.sun.jini.admin.DestroyAdmin

         */
        public void terminate() {
            if(!terminated) {
                for (Map.Entry<DestroyAdmin, Subject> mapEntry :
                    registrationMap.entrySet()) {
                    final DestroyAdmin dAdmin = mapEntry.getKey();
                    final Subject subject = mapEntry.getValue();
                    if (subject != null) {
                        try {
                            Subject.doAsPrivileged(subject,
                                                   new PrivilegedExceptionAction<Void>() {
                                                       public Void run() throws Exception {
                                                           try {
                                                               dAdmin.destroy();
                                                           } catch (Exception e) {
                                                               //e.printStackTrace();
                                                           }
                                                           return (null);
                                                       }
                                                   },
                                                   null);
                        } catch (PrivilegedActionException e) {
                            e.printStackTrace();
                        }
                    } else {
                        try {
                            dAdmin.destroy();
                        } catch (Exception e) {
                            //e.printStackTrace();
                        }
                    }

View Full Code Here

Examples of com.sun.jini.admin.DestroyAdmin

     * @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

Examples of com.sun.jini.admin.DestroyAdmin

         * @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 {
                    mgrLogger.info("[{}] Destroying original service", LoggingUtil.getLoggingName(svcElement));
View Full Code Here

Examples of com.sun.jini.admin.DestroyAdmin

            OperationalStringManager mgr = testManager.getOperationalStringManager();
            Assert.assertNotNull("Expected non-null OperationalStringManager", mgr);
            testManager.waitForDeployment(mgr);
            File marker = ForkImpl.getMarkerFile();
            Assert.assertTrue("The marker file should exist", marker.exists());
            DestroyAdmin dAdmin = (DestroyAdmin)cybernode.getAdmin();
            dAdmin.destroy();
            long t0 = System.currentTimeMillis();
            long maxWait=60*1000;
            long interval = 1000;
            long waited = 0;
            while(marker.exists() && waited <maxWait) {
View Full Code Here

Examples of com.sun.jini.admin.DestroyAdmin

                        if(serviceProxy instanceof Administrable) {
                            Administrable admin = (Administrable)serviceProxy;
                            Object adminObject = admin.getAdmin();

                            if(adminObject instanceof DestroyAdmin) {
                                DestroyAdmin destroyAdmin = (DestroyAdmin)adminObject;
                                destroyAdmin.destroy();
                                setDiscarded();
                                //container.discarded(identifier);
                                terminated.set(true);
                            } else {
                                logger.debug("No DestroyAdmin capabilities for {}", serviceProxy.getClass().getName());
View Full Code Here

Examples of com.sun.jini.admin.DestroyAdmin

                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 {
                getSLA().resetHighThreshold();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.