Java Code Examples for javax.management.ObjectName#getCanonicalKeyPropertyListString()
The following examples show how to use
javax.management.ObjectName#getCanonicalKeyPropertyListString() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Repository.java From hottub with GNU General Public License v2.0 | 5 votes |
/** * Builds a new ObjectNamePattern object from an ObjectName pattern. * @param pattern The ObjectName pattern under examination. **/ public ObjectNamePattern(ObjectName pattern) { this(pattern.isPropertyListPattern(), pattern.isPropertyValuePattern(), pattern.getCanonicalKeyPropertyListString(), pattern.getKeyPropertyList(), pattern); }
Example 2
Source File: Repository.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
/** * Builds a new ObjectNamePattern object from an ObjectName pattern. * @param pattern The ObjectName pattern under examination. **/ public ObjectNamePattern(ObjectName pattern) { this(pattern.isPropertyListPattern(), pattern.isPropertyValuePattern(), pattern.getCanonicalKeyPropertyListString(), pattern.getKeyPropertyList(), pattern); }
Example 3
Source File: Repository.java From JDKSourceCode1.8 with MIT License | 5 votes |
/** * Builds a new ObjectNamePattern object from an ObjectName pattern. * @param pattern The ObjectName pattern under examination. **/ public ObjectNamePattern(ObjectName pattern) { this(pattern.isPropertyListPattern(), pattern.isPropertyValuePattern(), pattern.getCanonicalKeyPropertyListString(), pattern.getKeyPropertyList(), pattern); }
Example 4
Source File: Repository.java From jdk8u_jdk with GNU General Public License v2.0 | 5 votes |
private void addNewDomMoi(final DynamicMBean object, final String dom, final ObjectName name, final RegistrationContext context) { final Map<String,NamedObject> moiTb = new HashMap<String,NamedObject>(); final String key = name.getCanonicalKeyPropertyListString(); addMoiToTb(object,name,key,moiTb,context); domainTb.put(dom, moiTb); nbElements++; }
Example 5
Source File: Repository.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
/** * Builds a new ObjectNamePattern object from an ObjectName pattern. * @param pattern The ObjectName pattern under examination. **/ public ObjectNamePattern(ObjectName pattern) { this(pattern.isPropertyListPattern(), pattern.isPropertyValuePattern(), pattern.getCanonicalKeyPropertyListString(), pattern.getKeyPropertyList(), pattern); }
Example 6
Source File: Repository.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
private void addNewDomMoi(final DynamicMBean object, final String dom, final ObjectName name, final RegistrationContext context) { final Map<String,NamedObject> moiTb = new HashMap<String,NamedObject>(); final String key = name.getCanonicalKeyPropertyListString(); addMoiToTb(object,name,key,moiTb,context); domainTb.put(dom, moiTb); nbElements++; }
Example 7
Source File: Repository.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
/** * Builds a new ObjectNamePattern object from an ObjectName pattern. * @param pattern The ObjectName pattern under examination. **/ public ObjectNamePattern(ObjectName pattern) { this(pattern.isPropertyListPattern(), pattern.isPropertyValuePattern(), pattern.getCanonicalKeyPropertyListString(), pattern.getKeyPropertyList(), pattern); }
Example 8
Source File: Repository.java From hottub with GNU General Public License v2.0 | 5 votes |
private void addNewDomMoi(final DynamicMBean object, final String dom, final ObjectName name, final RegistrationContext context) { final Map<String,NamedObject> moiTb = new HashMap<String,NamedObject>(); final String key = name.getCanonicalKeyPropertyListString(); addMoiToTb(object,name,key,moiTb,context); domainTb.put(dom, moiTb); nbElements++; }
Example 9
Source File: Repository.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
private void addNewDomMoi(final DynamicMBean object, final String dom, final ObjectName name, final RegistrationContext context) { final Map<String,NamedObject> moiTb = new HashMap<String,NamedObject>(); final String key = name.getCanonicalKeyPropertyListString(); addMoiToTb(object,name,key,moiTb,context); domainTb.put(dom, moiTb); nbElements++; }
Example 10
Source File: Repository.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
/** * Builds a new ObjectNamePattern object from an ObjectName pattern. * @param pattern The ObjectName pattern under examination. **/ public ObjectNamePattern(ObjectName pattern) { this(pattern.isPropertyListPattern(), pattern.isPropertyValuePattern(), pattern.getCanonicalKeyPropertyListString(), pattern.getKeyPropertyList(), pattern); }
Example 11
Source File: Repository.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
private void addNewDomMoi(final DynamicMBean object, final String dom, final ObjectName name, final RegistrationContext context) { final Map<String,NamedObject> moiTb = new HashMap<String,NamedObject>(); final String key = name.getCanonicalKeyPropertyListString(); addMoiToTb(object,name,key,moiTb,context); domainTb.put(dom, moiTb); nbElements++; }
Example 12
Source File: Repository.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 4 votes |
/** * Return true if the given ObjectName matches the ObjectName pattern * for which this object has been built. * WARNING: domain name is not considered here because it is supposed * not to be wildcard when called. PropertyList is also * supposed not to be zero-length. * @param name The ObjectName we want to match against the pattern. * @return true if <code>name</code> matches the pattern. **/ public boolean matchKeys(ObjectName name) { // If key property value pattern but not key property list // pattern, then the number of key properties must be equal // if (isPropertyValuePattern && !isPropertyListPattern && (name.getKeyPropertyList().size() != keys.length)) return false; // If key property value pattern or key property list pattern, // then every property inside pattern should exist in name // if (isPropertyValuePattern || isPropertyListPattern) { for (int i = keys.length - 1; i >= 0 ; i--) { // Find value in given object name for key at current // index in receiver // String v = name.getKeyProperty(keys[i]); // Did we find a value for this key ? // if (v == null) return false; // If this property is ok (same key, same value), go to next // if (isPropertyValuePattern && pattern.isPropertyValuePattern(keys[i])) { // wildmatch key property values // values[i] is the pattern; // v is the string if (Util.wildmatch(v,values[i])) continue; else return false; } if (v.equals(values[i])) continue; return false; } return true; } // If no pattern, then canonical names must be equal // final String p1 = name.getCanonicalKeyPropertyListString(); final String p2 = properties; return (p1.equals(p2)); }
Example 13
Source File: Repository.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 4 votes |
/** * Return true if the given ObjectName matches the ObjectName pattern * for which this object has been built. * WARNING: domain name is not considered here because it is supposed * not to be wildcard when called. PropertyList is also * supposed not to be zero-length. * @param name The ObjectName we want to match against the pattern. * @return true if <code>name</code> matches the pattern. **/ public boolean matchKeys(ObjectName name) { // If key property value pattern but not key property list // pattern, then the number of key properties must be equal // if (isPropertyValuePattern && !isPropertyListPattern && (name.getKeyPropertyList().size() != keys.length)) return false; // If key property value pattern or key property list pattern, // then every property inside pattern should exist in name // if (isPropertyValuePattern || isPropertyListPattern) { for (int i = keys.length - 1; i >= 0 ; i--) { // Find value in given object name for key at current // index in receiver // String v = name.getKeyProperty(keys[i]); // Did we find a value for this key ? // if (v == null) return false; // If this property is ok (same key, same value), go to next // if (isPropertyValuePattern && pattern.isPropertyValuePattern(keys[i])) { // wildmatch key property values // values[i] is the pattern; // v is the string if (Util.wildmatch(v,values[i])) continue; else return false; } if (v.equals(values[i])) continue; return false; } return true; } // If no pattern, then canonical names must be equal // final String p1 = name.getCanonicalKeyPropertyListString(); final String p2 = properties; return (p1.equals(p2)); }
Example 14
Source File: Repository.java From hottub with GNU General Public License v2.0 | 4 votes |
/** * Stores an MBean associated with its object name in the repository. * * @param object MBean to be stored in the repository. * @param name MBean object name. * @param context A registration context. If non null, the repository * will call {@link RegistrationContext#registering() * context.registering()} from within the repository * lock, when it has determined that the {@code object} * can be stored in the repository with that {@code name}. * If {@link RegistrationContext#registering() * context.registering()} throws an exception, the * operation is abandonned, the MBean is not added to the * repository, and a {@link RuntimeOperationsException} * is thrown. */ public void addMBean(final DynamicMBean object, ObjectName name, final RegistrationContext context) throws InstanceAlreadyExistsException { if (MBEANSERVER_LOGGER.isLoggable(Level.FINER)) { MBEANSERVER_LOGGER.logp(Level.FINER, Repository.class.getName(), "addMBean", "name = " + name); } // Extract the domain name. String dom = name.getDomain().intern(); boolean to_default_domain = false; // Set domain to default if domain is empty and not already set if (dom.length() == 0) name = Util.newObjectName(domain + name.toString()); // Do we have default domain ? if (dom == domain) { // ES: OK (dom & domain are interned) to_default_domain = true; dom = domain; } else { to_default_domain = false; } // Validate name for an object if (name.isPattern()) { throw new RuntimeOperationsException( new IllegalArgumentException("Repository: cannot add mbean for " + "pattern name " + name.toString())); } lock.writeLock().lock(); try { // Domain cannot be JMImplementation if entry does not exist if ( !to_default_domain && dom.equals("JMImplementation") && domainTb.containsKey("JMImplementation")) { throw new RuntimeOperationsException( new IllegalArgumentException( "Repository: domain name cannot be JMImplementation")); } // If domain does not already exist, add it to the hash table final Map<String,NamedObject> moiTb = domainTb.get(dom); if (moiTb == null) { addNewDomMoi(object, dom, name, context); return; } 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); } } } finally { lock.writeLock().unlock(); } }
Example 15
Source File: Repository.java From hottub with GNU General Public License v2.0 | 4 votes |
/** * Return true if the given ObjectName matches the ObjectName pattern * for which this object has been built. * WARNING: domain name is not considered here because it is supposed * not to be wildcard when called. PropertyList is also * supposed not to be zero-length. * @param name The ObjectName we want to match against the pattern. * @return true if <code>name</code> matches the pattern. **/ public boolean matchKeys(ObjectName name) { // If key property value pattern but not key property list // pattern, then the number of key properties must be equal // if (isPropertyValuePattern && !isPropertyListPattern && (name.getKeyPropertyList().size() != keys.length)) return false; // If key property value pattern or key property list pattern, // then every property inside pattern should exist in name // if (isPropertyValuePattern || isPropertyListPattern) { for (int i = keys.length - 1; i >= 0 ; i--) { // Find value in given object name for key at current // index in receiver // String v = name.getKeyProperty(keys[i]); // Did we find a value for this key ? // if (v == null) return false; // If this property is ok (same key, same value), go to next // if (isPropertyValuePattern && pattern.isPropertyValuePattern(keys[i])) { // wildmatch key property values // values[i] is the pattern; // v is the string if (Util.wildmatch(v,values[i])) continue; else return false; } if (v.equals(values[i])) continue; return false; } return true; } // If no pattern, then canonical names must be equal // final String p1 = name.getCanonicalKeyPropertyListString(); final String p2 = properties; return (p1.equals(p2)); }
Example 16
Source File: Repository.java From jdk8u-jdk with GNU General Public License v2.0 | 4 votes |
/** * Stores an MBean associated with its object name in the repository. * * @param object MBean to be stored in the repository. * @param name MBean object name. * @param context A registration context. If non null, the repository * will call {@link RegistrationContext#registering() * context.registering()} from within the repository * lock, when it has determined that the {@code object} * can be stored in the repository with that {@code name}. * If {@link RegistrationContext#registering() * context.registering()} throws an exception, the * operation is abandonned, the MBean is not added to the * repository, and a {@link RuntimeOperationsException} * is thrown. */ public void addMBean(final DynamicMBean object, ObjectName name, final RegistrationContext context) throws InstanceAlreadyExistsException { if (MBEANSERVER_LOGGER.isLoggable(Level.FINER)) { MBEANSERVER_LOGGER.logp(Level.FINER, Repository.class.getName(), "addMBean", "name = " + name); } // Extract the domain name. String dom = name.getDomain().intern(); boolean to_default_domain = false; // Set domain to default if domain is empty and not already set if (dom.length() == 0) name = Util.newObjectName(domain + name.toString()); // Do we have default domain ? if (dom == domain) { // ES: OK (dom & domain are interned) to_default_domain = true; dom = domain; } else { to_default_domain = false; } // Validate name for an object if (name.isPattern()) { throw new RuntimeOperationsException( new IllegalArgumentException("Repository: cannot add mbean for " + "pattern name " + name.toString())); } lock.writeLock().lock(); try { // Domain cannot be JMImplementation if entry does not exist if ( !to_default_domain && dom.equals("JMImplementation") && domainTb.containsKey("JMImplementation")) { throw new RuntimeOperationsException( new IllegalArgumentException( "Repository: domain name cannot be JMImplementation")); } // If domain does not already exist, add it to the hash table final Map<String,NamedObject> moiTb = domainTb.get(dom); if (moiTb == null) { addNewDomMoi(object, dom, name, context); return; } 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); } } } finally { lock.writeLock().unlock(); } }
Example 17
Source File: Repository.java From openjdk-jdk9 with GNU General Public License v2.0 | 4 votes |
/** * Stores an MBean associated with its object name in the repository. * * @param object MBean to be stored in the repository. * @param name MBean object name. * @param context A registration context. If non null, the repository * will call {@link RegistrationContext#registering() * context.registering()} from within the repository * lock, when it has determined that the {@code object} * can be stored in the repository with that {@code name}. * If {@link RegistrationContext#registering() * context.registering()} throws an exception, the * operation is abandonned, the MBean is not added to the * repository, and a {@link RuntimeOperationsException} * is thrown. */ public void addMBean(final DynamicMBean object, ObjectName name, final RegistrationContext context) throws InstanceAlreadyExistsException { if (MBEANSERVER_LOGGER.isLoggable(Level.TRACE)) { MBEANSERVER_LOGGER.log(Level.TRACE, "name = " + name); } // Extract the domain name. String dom = name.getDomain().intern(); boolean to_default_domain = false; // Set domain to default if domain is empty and not already set if (dom.length() == 0) name = Util.newObjectName(domain + name.toString()); // Do we have default domain ? if (dom == domain) { // ES: OK (dom & domain are interned) to_default_domain = true; dom = domain; } else { to_default_domain = false; } // Validate name for an object if (name.isPattern()) { throw new RuntimeOperationsException( new IllegalArgumentException("Repository: cannot add mbean for " + "pattern name " + name.toString())); } lock.writeLock().lock(); try { // Domain cannot be JMImplementation if entry does not exist if ( !to_default_domain && dom.equals("JMImplementation") && domainTb.containsKey("JMImplementation")) { throw new RuntimeOperationsException( new IllegalArgumentException( "Repository: domain name cannot be JMImplementation")); } // If domain does not already exist, add it to the hash table final Map<String,NamedObject> moiTb = domainTb.get(dom); if (moiTb == null) { addNewDomMoi(object, dom, name, context); return; } 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); } } } finally { lock.writeLock().unlock(); } }
Example 18
Source File: Repository.java From jdk8u60 with GNU General Public License v2.0 | 4 votes |
/** * Stores an MBean associated with its object name in the repository. * * @param object MBean to be stored in the repository. * @param name MBean object name. * @param context A registration context. If non null, the repository * will call {@link RegistrationContext#registering() * context.registering()} from within the repository * lock, when it has determined that the {@code object} * can be stored in the repository with that {@code name}. * If {@link RegistrationContext#registering() * context.registering()} throws an exception, the * operation is abandonned, the MBean is not added to the * repository, and a {@link RuntimeOperationsException} * is thrown. */ public void addMBean(final DynamicMBean object, ObjectName name, final RegistrationContext context) throws InstanceAlreadyExistsException { if (MBEANSERVER_LOGGER.isLoggable(Level.FINER)) { MBEANSERVER_LOGGER.logp(Level.FINER, Repository.class.getName(), "addMBean", "name = " + name); } // Extract the domain name. String dom = name.getDomain().intern(); boolean to_default_domain = false; // Set domain to default if domain is empty and not already set if (dom.length() == 0) name = Util.newObjectName(domain + name.toString()); // Do we have default domain ? if (dom == domain) { // ES: OK (dom & domain are interned) to_default_domain = true; dom = domain; } else { to_default_domain = false; } // Validate name for an object if (name.isPattern()) { throw new RuntimeOperationsException( new IllegalArgumentException("Repository: cannot add mbean for " + "pattern name " + name.toString())); } lock.writeLock().lock(); try { // Domain cannot be JMImplementation if entry does not exist if ( !to_default_domain && dom.equals("JMImplementation") && domainTb.containsKey("JMImplementation")) { throw new RuntimeOperationsException( new IllegalArgumentException( "Repository: domain name cannot be JMImplementation")); } // If domain does not already exist, add it to the hash table final Map<String,NamedObject> moiTb = domainTb.get(dom); if (moiTb == null) { addNewDomMoi(object, dom, name, context); return; } 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); } } } finally { lock.writeLock().unlock(); } }
Example 19
Source File: Repository.java From JDKSourceCode1.8 with MIT License | 4 votes |
/** * Return true if the given ObjectName matches the ObjectName pattern * for which this object has been built. * WARNING: domain name is not considered here because it is supposed * not to be wildcard when called. PropertyList is also * supposed not to be zero-length. * @param name The ObjectName we want to match against the pattern. * @return true if <code>name</code> matches the pattern. **/ public boolean matchKeys(ObjectName name) { // If key property value pattern but not key property list // pattern, then the number of key properties must be equal // if (isPropertyValuePattern && !isPropertyListPattern && (name.getKeyPropertyList().size() != keys.length)) return false; // If key property value pattern or key property list pattern, // then every property inside pattern should exist in name // if (isPropertyValuePattern || isPropertyListPattern) { for (int i = keys.length - 1; i >= 0 ; i--) { // Find value in given object name for key at current // index in receiver // String v = name.getKeyProperty(keys[i]); // Did we find a value for this key ? // if (v == null) return false; // If this property is ok (same key, same value), go to next // if (isPropertyValuePattern && pattern.isPropertyValuePattern(keys[i])) { // wildmatch key property values // values[i] is the pattern; // v is the string if (Util.wildmatch(v,values[i])) continue; else return false; } if (v.equals(values[i])) continue; return false; } return true; } // If no pattern, then canonical names must be equal // final String p1 = name.getCanonicalKeyPropertyListString(); final String p2 = properties; return (p1.equals(p2)); }
Example 20
Source File: Repository.java From openjdk-8-source with GNU General Public License v2.0 | 4 votes |
/** * Return true if the given ObjectName matches the ObjectName pattern * for which this object has been built. * WARNING: domain name is not considered here because it is supposed * not to be wildcard when called. PropertyList is also * supposed not to be zero-length. * @param name The ObjectName we want to match against the pattern. * @return true if <code>name</code> matches the pattern. **/ public boolean matchKeys(ObjectName name) { // If key property value pattern but not key property list // pattern, then the number of key properties must be equal // if (isPropertyValuePattern && !isPropertyListPattern && (name.getKeyPropertyList().size() != keys.length)) return false; // If key property value pattern or key property list pattern, // then every property inside pattern should exist in name // if (isPropertyValuePattern || isPropertyListPattern) { for (int i = keys.length - 1; i >= 0 ; i--) { // Find value in given object name for key at current // index in receiver // String v = name.getKeyProperty(keys[i]); // Did we find a value for this key ? // if (v == null) return false; // If this property is ok (same key, same value), go to next // if (isPropertyValuePattern && pattern.isPropertyValuePattern(keys[i])) { // wildmatch key property values // values[i] is the pattern; // v is the string if (Util.wildmatch(v,values[i])) continue; else return false; } if (v.equals(values[i])) continue; return false; } return true; } // If no pattern, then canonical names must be equal // final String p1 = name.getCanonicalKeyPropertyListString(); final String p2 = properties; return (p1.equals(p2)); }