/** * Create a new ServiceDependencyValueMetaData. * * @param dependency the dependents object name * @param proxyType the proxy type */ public ServiceDependencyValueMetaData(String dependency, String proxyType) { setDependency(dependency); setProxyType(proxyType); }
private void addDependsValue(String name, ServiceDependencyValueMetaData dependsMetaData, Element mbean) { Element depends = document.createElement("depends"); depends.setAttribute("optional-attribute-name", name); if(dependsMetaData.getProxyType() != null) depends.setAttribute("proxy-type", dependsMetaData.getProxyType()); depends.setTextContent(dependsMetaData.getDependency()); mbean.appendChild(depends); }
ServiceDependencyValueMetaData dependencyValue = new ServiceDependencyValueMetaData(); dependencyValue.setDependency(subjaccPolicy.getObjectName().toString()); dependencyValue.setProxyType("attribute"); serviceAttributeMetaData.setValue(dependencyValue); parentServiceMetaData.addAttribute(serviceAttributeMetaData);
public ServiceAttributeMetaData buildDependencyAttribute(String name, String dependency) { ServiceAttributeMetaData att = new ServiceAttributeMetaData(); ServiceDependencyValueMetaData dep = new ServiceDependencyValueMetaData(); dep.setDependency(dependency); if(name != null) att.setName(name); att.setValue(dep); return att; }
/** * Create a new ServiceDependencyValueMetaData. * * @param dependency the dependents object name */ public ServiceDependencyValueMetaData(String dependency) { setDependency(dependency); }
public Object getValue(ServiceValueContext valueContext) throws Exception { MBeanAttributeInfo attributeInfo = valueContext.getAttributeInfo(); ClassLoader cl = valueContext.getClassloader(); MBeanServer server = valueContext.getServer(); ObjectName objectName = getObjectName(); if (proxyType != null) { if (proxyType.equals("attribute")) { proxyType = attributeInfo.getType(); if (proxyType == null) throw new ConfigurationException("AttributeInfo for " + attributeInfo.getName() + " has no type"); } Class<?> proxyClass = cl.loadClass(proxyType); return MBeanProxyExt.create(proxyClass, objectName, server, true); } return objectName; }
depends.setObjectName((ObjectName) plainValue); else depends.setDependency(String.valueOf(plainValue));
ServiceValueMetaData value = new ServiceDependencyValueMetaData(dependsObjectName, proxyType); ServiceAttributeMetaData attribute = new ServiceAttributeMetaData(); attribute.setName(mbeanRefName);
ServiceDependencyValueMetaData dependencyValue = new ServiceDependencyValueMetaData(); dependencyValue.setDependency(getTransactionManagerServiceName()); dependencyValue.setProxyType("attribute"); attr.setValue(dependencyValue); attrs.add(attr); ServiceDependencyValueMetaData wsDepends = new ServiceDependencyValueMetaData(); wsDepends.setDependency(wsName); ws.setValue(wsDepends); attrs.add(ws); ServiceDependencyValueMetaData tmsDepends = new ServiceDependencyValueMetaData(); tms.setName("TimerService"); tmsDepends.setDependency(timerServiceName); tmsDepends.setProxyType("attribute"); tms.setValue(tmsDepends); attrs.add(tms);
/** * Create a new ServiceDependencyValueMetaData. * * @param dependency the dependents object name */ public ServiceDependencyValueMetaData(String dependency) { setDependency(dependency); }
public Object getValue(ServiceValueContext valueContext) throws Exception { MBeanAttributeInfo attributeInfo = valueContext.getAttributeInfo(); ClassLoader cl = valueContext.getClassloader(); MBeanServer server = valueContext.getServer(); ObjectName objectName = getObjectName(); if (proxyType != null) { if (proxyType.equals("attribute")) { proxyType = attributeInfo.getType(); if (proxyType == null) throw new ConfigurationException("AttributeInfo for " + attributeInfo.getName() + " has no type"); } Class<?> proxyClass = cl.loadClass(proxyType); return MBeanProxyExt.create(proxyClass, objectName, server, true); } return objectName; }
ServiceValueMetaData value = new ServiceDependencyValueMetaData(dependsObjectName, proxyType); ServiceAttributeMetaData attribute = new ServiceAttributeMetaData(); attribute.setName(mbeanRefName);
/** * Create a new ServiceDependencyValueMetaData. * * @param dependency the dependents object name * @param proxyType the proxy type */ public ServiceDependencyValueMetaData(String dependency, String proxyType) { setDependency(dependency); setProxyType(proxyType); }
public void visit(ServiceMetaDataVisitor visitor) { ServiceControllerContext context = visitor.getControllerContext(); Object name = context.getName(); Object other = dependency; try { other = getObjectName().getCanonicalName(); } catch (MalformedObjectNameException ignored) { } // TODO visitor.addDependency(new LifecycleDependencyItem(name, other, ControllerState.CONFIGURED)); visitor.addDependency(new LifecycleDependencyItem(name, other, ControllerState.CREATE)); visitor.addDependency(new LifecycleDependencyItem(name, other, ControllerState.START)); visitor.visit(this); } }
private void addDependsValue(String name, ServiceDependencyValueMetaData dependsMetaData, Element mbean) { Element depends = document.createElement("depends"); depends.setAttribute("optional-attribute-name", name); if(dependsMetaData.getProxyType() != null) depends.setAttribute("proxy-type", dependsMetaData.getProxyType()); depends.setTextContent(dependsMetaData.getDependency()); mbean.appendChild(depends); }
public void visit(ServiceMetaDataVisitor visitor) { ServiceControllerContext context = visitor.getControllerContext(); Object name = context.getName(); Object other = dependency; try { other = getObjectName().getCanonicalName(); } catch (MalformedObjectNameException ignored) { } // TODO visitor.addDependency(new LifecycleDependencyItem(name, other, ControllerState.CONFIGURED)); visitor.addDependency(new LifecycleDependencyItem(name, other, ControllerState.CREATE)); visitor.addDependency(new LifecycleDependencyItem(name, other, ControllerState.START)); visitor.visit(this); } }
value = depends.getObjectName();