[Design of POJO Server] - @ManagementRuntimeRef/@ManagementObjectRef/@ManagementObject
by scott.stark@jboss.org
We need to clarify the usage of the names in the ManagedObject graphs for the purposes of references between related ManagedObjects and references to the underlying runtime component. The current mechanism for naming a ManagedObject is based on the
@ManagementObjectID - annotation that identifies a ManagedObject key/type qualifier source. Generally this is on a property without a name value so that the actual name comes from the property value, as this JBossManagedConnectionPool example shows:
| @ManagementObjectID(type="DataSource")
| @ManagementProperty(use={ViewUse.RUNTIME})
| public String getPoolJndiName()
| {
| return this.poolJndiName;
| }
|
@ManagementObjectRef - indicates a property that references another ManagedObject. This ManagedConnectionFactoryDeploymentMetaData example shows a property refencing the jmx invoker ManagedObject:
| @ManagementProperty(name="jmx-invoker-name")
| @ManagementObjectRef(type="JMXInvoker")
| public String getJmxInvokerName()
| {
| return jmxInvokerName;
| }
|
@ManagementRuntimeRef - annotation that can be used to identify which property defines the runtime component name. This annotation takes a transformer:
| public interface RuntimeComponentNameTransformer
| {
| /**
| * Transform the name from string.
| *
| * @param value current name value
| * @return transformed name
| */
| Object transform(Object value);
| }
|
this is used to identify what the name of the runtime kernel component is. For an mcf deployment, this should be doing the same mapping logic the ManagedConnectionFactoryBuilder.buildObjectName method does in transforming the jndiName property into an ObjectName:
| public ObjectName buildObjectName(ManagedConnectionFactoryDeploymentMetaData md)
| {
| return ObjectNameFactory.create(MCF_JMX + md.getJndiName());
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4114515#4114515
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4114515
16 years, 5 months
[Design of POJO Server] - Re: property values in ManagementViewImpl.applyTemplate
by alex.loubyansky@jboss.com
"Scott" wrote : Ales did the dispatch work, so I'm not sure how the component registry
| is being maintained. The getComponentName method relies on the
| ManagedObject.targetManagedObject setting, and this relies on the
| @ManagementObjectRef/@ManagementObjectID annotations for the relations.
|
| When you say connection factories, what property are you talking about?
| A connection factory should have a component name based on its
| @ManagementObjectID. The logic in getComponentName should also be
| considering ManagedObjects with a proper name as a connection factory
| would, based on its jndiName property:
|
| @ManagementProperty(name="jndi-name", description="The global JNDI
| name to bind the factory under")
| @ManagementObjectID(type="DataSource")
| public String getJndiName()
| {
| return jndiName;
| }
|
| Looking at the logic for setting the ManagedObject.setComponentName
| value, the componentName relies on a ManagementRuntimeRef. This is
| something Ales added. Let's move this discussion to the forum as there
| needs to be a general understanding of how ManagedObjects are named and
| referenced.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4114514#4114514
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4114514
16 years, 5 months
[Design of POJO Server] - property values in ManagementViewImpl.applyTemplate
by alex.loubyansky@jboss.com
The following part in ManagementViewImpl looks strange to me.
What is the logic with serializable?
The componentName for connection factories is always null. Even if it wasn't, they wouldn't be registered to the kernel, would they? Or I missing the part where they are registered?
Thanks!
public void applyTemplate(DeploymentPhase phase, String deploymentBaseName, DeploymentTemplateInfo info)
| ...
| // TODO - decide what is the type of value when we set it
| // since currently get always returns MetaValue, but we see some cases
| // where plain Serializable is enough
| Serializable serializable;
| MetaValue metaValue;
| Object value = prop.getValue();
| if (value instanceof MetaValue)
| {
| metaValue = (MetaValue)value;
| MetaType metaType = metaValue.getMetaType();
| if (metaType.isSimple())
| serializable = ((SimpleValue)metaValue).getValue();
| else if (metaType.isGeneric())
| serializable = ((GenericValue)metaValue).getValue();
| else
| serializable = null;
| }
| else
| {
| serializable = (Serializable)value;
| metaValue = metaValueFactory.create(value);
| }
| // I add this check for the tests to pass if(serializable != null)
| ctxProp.setValue(serializable);
| // todo - should this also dispatch to runtime component?
| Object componentName = getComponentName(ctxProp);
| if("xa-datasource-properties".equals(ctxProp.getName()))
| System.out.println("componentName for prop=" + ctxProp.getName() + ": " + componentName + " " + ctxProp.getManagedObject());
| if (componentName != null)
| dispatcher.set(componentName, ctxProp.getName(), metaValue);
| }
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4114513#4114513
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4114513
16 years, 5 months
[Design the new POJO MicroContainer] - Dependencies clash with jbossxb
by bdaw
I found out that MC and JBossXB duplicates jaxb-api dependency.
MC 2.0.0.Beta9 depends on javax,xml.binding/jaxb-api (
JBossXB 2.0.0.CR5 depends on sun-jaxb/jaxb-api
So same artifact but different groupId...
And btw. as I'm here... Do you have any idea why I'm seeing this exception? I suspect something wrong in my classpath (as its maven...) but I can't track anything:
[java] Caused by: org.jboss.xb.binding.JBossXBException: Failed to parse source: jar:file:/home/bdaw/.m2/repository/org/jboss/unit/jboss-unit-remote/1.1.0-SNAPSHOT/jboss-unit-remote-1.1.0-SNAPSHOT.jar!/org/jboss/unit/remote/driver/jboss-beans.xml@26,49
| [java] at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:177)
| [java] at org.jboss.xb.binding.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:139)
| [java] at org.jboss.kernel.plugins.deployment.xml.BeanXMLDeployer.deploy(BeanXMLDeployer.java:86)
| [java] at org.jboss.unit.remote.driver.RemoteTestDriverClient.initDriver(RemoteTestDriverClient.java:179)
| [java] ... 8 more
| [java] Caused by: java.lang.NullPointerException
| [java] at org.jboss.kernel.plugins.deployment.xml.BeanSchemaBindingHelper.initLazyHandlers(BeanSchemaBindingHelper.java:197)
| [java] at org.jboss.kernel.plugins.deployment.xml.BeanSchemaBinding20.initLazy(BeanSchemaBinding20.java:298)
| [java] at org.jboss.kernel.plugins.deployment.xml.BeanSchemaBinding20.init(BeanSchemaBinding20.java:249)
| [java] at org.jboss.kernel.plugins.deployment.xml.BeanSchemaInitializer20.init(BeanSchemaInitializer20.java:37)
I'm migrating stuff from ant to maven so its definitely not because of wrong 'jboss-beans.xml'. Currenlty I'm trying with 2.0.0.Beta9, With 2.0.0.Beta4 (worked in ant build) the NPE happens little later in the flow but in the same class.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4114464#4114464
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4114464
16 years, 5 months