Examples of InstanceAlreadyExistsException


Examples of javax.management.InstanceAlreadyExistsException

            } else {
                // Add instance if not already present
                String cstr = name.getCanonicalKeyPropertyListString();
                NamedObject elmt= moiTb.get(cstr);
                if (elmt != null) {
                    throw new InstanceAlreadyExistsException(name.toString());
                } else {
                    nbElements++;
                    addMoiToTb(object,name,cstr,moiTb,context);
                }
            }
View Full Code Here

Examples of javax.management.InstanceAlreadyExistsException

        ObjectName existing = mxbeanToObjectName.get(mxbean);
        if (existing != null) {
            String multiname = AccessController.doPrivileged(
                    new GetPropertyAction("jmx.mxbean.multiname"));
            if (!"true".equalsIgnoreCase(multiname)) {
                throw new InstanceAlreadyExistsException(
                        "MXBean already registered with name " + existing);
            }
        }
        mxbeanToObjectName.put(mxbean, name);
    }
View Full Code Here

Examples of javax.management.InstanceAlreadyExistsException

            // Add instance if not already present
            String cstr = name.getCanonicalKeyPropertyListString();
            NamedObject elmt= moiTb.get(cstr);
            if (elmt != null) {
                throw new InstanceAlreadyExistsException(name.toString());
            } else {
                nbElements++;
                moiTb.put(cstr, new NamedObject(name, object));
            }
View Full Code Here

Examples of javax.management.InstanceAlreadyExistsException

        synchronized (lock) {
            if (this.objectName != null) {
                final String msg =
                    "MXBean already registered with name " + this.objectName;
                throw new InstanceAlreadyExistsException(msg);
            }
            this.mxbeanLookup = MXBeanLookup.lookupFor(server);
            this.mxbeanLookup.addReference(name, getResource());
            this.objectName = name;
        }
View Full Code Here

Examples of javax.management.InstanceAlreadyExistsException

    public ObjectName preRegister(MBeanServer server, ObjectName name)
            throws Exception {
        // Allow only one initialization of the MIB.
        //
        if (isInitialized == true) {
            throw new InstanceAlreadyExistsException();
        }

        // Initialize MBeanServer information.
        //
        this.server = server;
View Full Code Here

Examples of javax.management.InstanceAlreadyExistsException

      for (Iterator it = mbeans.iterator(); it.hasNext();) {
    final ObjectName sourceName = (ObjectName)it.next();
    final ObjectName targetName = getTargetName(sourceName);
    if (mbs.isRegistered(targetName) && !conflictAllowed) {
        nameConflictDetected("start",targetName);
        throw new InstanceAlreadyExistsException(
               String.valueOf(targetName));
    } else names[count++]=sourceName;
      }

      for (int i=0;i<count;i++)
View Full Code Here

Examples of javax.management.InstanceAlreadyExistsException

      // Create a properties -> entry map if we don't have one
      Map mbeanMap = getMBeanMap(domain, true);

      // Make sure we aren't already registered
      if (mbeanMap.get(props) != null)
         throw new InstanceAlreadyExistsException(name + " already registered.");

      // Ok, we are registered
      mbeanMap.put(props, entry);
   }
View Full Code Here

Examples of javax.management.InstanceAlreadyExistsException

    {
        if (name == null) {
            throw new UnsupportedOperationException("Only explicit name supported at this time");
        }
        if (reportedBeans.putIfAbsent(name, reportedBean) != null) {
            throw new InstanceAlreadyExistsException(name + " is already registered");
        }
    }
View Full Code Here

Examples of javax.management.InstanceAlreadyExistsException

/* 760 */     String props = name.getCanonicalKeyPropertyListString();
/*     */
/* 763 */     Map mbeanMap = getMBeanMap(domain, true);
/*     */
/* 766 */     if (mbeanMap.get(props) != null) {
/* 767 */       throw new InstanceAlreadyExistsException(name + " already registered.");
/*     */     }
/*     */
/* 770 */     mbeanMap.put(props, entry);
/*     */   }
View Full Code Here

Examples of javax.management.InstanceAlreadyExistsException

        }

        DynamicMBean mbean = (DynamicMBean) object;

        if (mbeans.containsKey(name)) {
            throw new InstanceAlreadyExistsException(format("MBean already registered: %s", name));
        }

        mbeans.put(name, mbean);

        return new ObjectInstance(name, mbean.getMBeanInfo().getClassName());
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.