/** * Get the classloader domain name * * @return the domain */ public String getDomainName() { if (domain == null) return null; return ((ClassLoaderDomain) domain).getName(); }
public String getParentDomainName() { if (parent == null || parent instanceof ClassLoaderDomain == false) return null; ClassLoaderDomain parentDomain = (ClassLoaderDomain) parent; return parentDomain.getName(); }
public String getParentDomainName() { if (parent == null || parent instanceof ClassLoaderDomain == false) return null; ClassLoaderDomain parentDomain = (ClassLoaderDomain) parent; return parentDomain.getName(); }
/** * Get the classloader domain name * * @return the domain */ public String getDomainName() { if (domain == null) return null; return ((ClassLoaderDomain) domain).getName(); }
/** * Is a domain registered * * @param domain the domain * @return true when the domain is registered * @throws IllegalArgumentException for a null domain */ public boolean isDomainRegistered(ClassLoaderDomain domain) { if (domain == null) throw new IllegalArgumentException("Null domain"); return getDomain(domain.getName()) == domain; }
/** * Is a domain registered * * @param domain the domain * @return true when the domain is registered * @throws IllegalArgumentException for a null domain */ public boolean isDomainRegistered(ClassLoaderDomain domain) { if (domain == null) throw new IllegalArgumentException("Null domain"); return getDomain(domain.getName()) == domain; }
/** * Get an object name for the domain * * @param domain the domain * @return the object name */ protected ObjectName getObjectName(ClassLoaderDomain domain) { if (domain == null) throw new IllegalArgumentException("Null domain"); Hashtable<String, String> properties = new Hashtable<String, String>(); properties.put("domain", "\"" + domain.getName() + "\""); properties.put("system", "" + System.identityHashCode(this)); try { return ObjectName.getInstance("jboss.classloader", properties); } catch (MalformedObjectNameException e) { throw new RuntimeException("Unexpected error", e); } }
/** * Get an object name for the domain * * @param domain the domain * @return the object name */ protected ObjectName getObjectName(ClassLoaderDomain domain) { if (domain == null) throw new IllegalArgumentException("Null domain"); Hashtable<String, String> properties = new Hashtable<String, String>(); properties.put("domain", "\"" + domain.getName() + "\""); properties.put("system", "" + System.identityHashCode(this)); try { return ObjectName.getInstance("jboss.classloader", properties); } catch (MalformedObjectNameException e) { throw new RuntimeException("Unexpected error", e); } }
public void setSystem(ClassLoaderSystem system) { if (system == null) throw new IllegalArgumentException("Null system"); this.system = system; defaultDomain = system.getDefaultDomain(); defaultClasspath = new ClasspathImpl(defaultDomain.getName()); }
/** * Unregister a domain * * @param domain the domain * @throws IllegalArgumentException for a null domain or if you attempt to unregister the default domain * @throws IllegalStateException if a domain is not registered */ public synchronized void unregisterDomain(ClassLoaderDomain domain) { if (isDomainRegistered(domain) == false) throw new IllegalStateException("Domain is not registered " + domain); if (DEFAULT_DOMAIN_NAME.equals(domain.getName())) throw new IllegalArgumentException("Cannot unregister the default domain"); internalUnregisterDomain(domain); }
/** * Unregister a domain * * @param domain the domain * @throws IllegalArgumentException for a null domain or if you attempt to unregister the default domain * @throws IllegalStateException if a domain is not registered */ public synchronized void unregisterDomain(ClassLoaderDomain domain) { if (isDomainRegistered(domain) == false) throw new IllegalStateException("Domain is not registered " + domain); if (DEFAULT_DOMAIN_NAME.equals(domain.getName())) throw new IllegalArgumentException("Cannot unregister the default domain"); internalUnregisterDomain(domain); }
/** * For subclasses to add information for toLongString() * * @param builder the builder */ protected void toLongString(StringBuilder builder) { builder.append("name=").append(getName()); builder.append(" parentPolicy=").append(getParentPolicy()); builder.append(" parent="); Loader parent = getParent(); if (parent != null) builder.append(parent); else builder.append(getParentClassLoader()); }
/** * For subclasses to add information for toLongString() * * @param builder the builder */ protected void toLongString(StringBuilder builder) { builder.append("name=").append(getName()); builder.append(" parentPolicy=").append(getParentPolicy()); builder.append(" parent="); Loader parent = getParent(); if (parent != null) builder.append(parent); else builder.append(getParentClassLoader()); }
/** * Register a domain * * @param domain the domain * @throws IllegalArgumentException for a null domain * @throws IllegalStateException if a domain is already registered with this name */ public synchronized void registerDomain(ClassLoaderDomain domain) { if (domain == null) throw new IllegalArgumentException("Null domain"); String name = domain.getName(); if (isRegistered(name)) throw new IllegalStateException("A domain is already registered with name " + name); internalRegisterDomain(name, domain); }
/** * Register a domain * * @param domain the domain * @throws IllegalArgumentException for a null domain * @throws IllegalStateException if a domain is already registered with this name */ public synchronized void registerDomain(ClassLoaderDomain domain) { if (domain == null) throw new IllegalArgumentException("Null domain"); String name = domain.getName(); if (isRegistered(name)) throw new IllegalStateException("A domain is already registered with name " + name); internalRegisterDomain(name, domain); }
/** * Unregister a domain * * @param domain the domain * @throws IllegalArgumentException for a null domain or if you attempt to unregister the default domain * @throws IllegalStateException if a domain is not registered */ private synchronized void internalUnregisterDomain(ClassLoaderDomain domain) { unregisterDomainMBean(domain); registeredDomains.remove(domain.getName()); super.unregisterDomain(domain); log.debug(this + " unregistered domain=" + domain.toLongString()); }
/** * Unregister a domain * * @param domain the domain * @throws IllegalArgumentException for a null domain or if you attempt to unregister the default domain * @throws IllegalStateException if a domain is not registered */ private synchronized void internalUnregisterDomain(ClassLoaderDomain domain) { unregisterDomainMBean(domain); registeredDomains.remove(domain.getName()); super.unregisterDomain(domain); log.debug(this + " unregistered domain=" + domain.toLongString()); }
poolDomain = new JBossClClassPoolDomain(domain.getName(), parentPoolDomain, domain.getParentPolicy(), registry); if (parentUnitPool == null) poolDomain = new JBossClClassPoolDomain(domain.getName(), domain.getParentPolicy(), registry); poolDomain = new JBossClClassPoolDomain(domain.getName(), parentUnitPool, domain.getParentPolicy(), registry);
classpath = new NoDuplicatesClasspath(clDomain.getName(), parentClasspath);