[Design of POJO Server] - Re: ProfileService todos for deployer changes
by scott.stark@jboss.org
The direction I'm currently heading is to generalize the profile service DeployerAspects to build the ManagedDeployment/ManagedComponent tree from the deployment metadata. The metadata handlers would come from the deployers who handle the associated component metadata. A component handler is something like:
| public interface ManagedDeploymentCreator<T>
| {
| public buildComponents(ManagedDeployment ctx, Set<? extends T> metaData);
| }
|
And the *-service.xml component handler would be:
| public class ServiceMetaDataManagedDeploymentCreator
| implements ManagedDeploymentCreator<ServiceMetaData>
| {
|
| public void buildComponents(ManagedDeployment ctx, Set<? extends ServiceMetaData> metaData)
| {
| ...
| }
|
| }
|
The DeployerAspects builds up the ManagedDeployment/ManagedComponent graph by calling out to the ManagedDeploymentCreators:
| public class DeployerAspects
| {
| /** The metadata type to ManagedComponent handlers */
| private Map<Class, ManagedDeploymentCreator> mdCreators;
| ...
| ManagedDeployment md = ...;
| for(Class mdType : mdCreators.keySet())
| {
| Set metadata = unit.getAllMetaData(mdType);
| if( metadata == null || metadata.size() == 0 )
| continue;
| ManagedDeploymentCreator creator = mdCreators.get(mdType);
| creator.buildComponents(md, metadata);
| }
|
There can be interaction between multiple ManagedDeploymentCreators. For example, with jca, the factories(the managed components) and properties are determined by the ManagedConnectionFactoryDeploymentGroup metadata, but there are runtime ops and stats that have to come from the ServiceMetaData of the mbeans that the jca layer currently uses as the runtime objects implementing the factories. Those mbeans should not be showing up as some manageable sar, while jms destinations currently are deployed as just a collection of mbeans.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4066236#4066236
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4066236
18 years, 8 months
[Design the new POJO MicroContainer] - Re: Property lookup interceptors
by alesj
"adrian(a)jboss.org" wrote :
| But I don't think the value factory needs to know the default value,
| it just returns "null" when it doesn't have the property.
|
| | <property name="x">
| | <value-factory bean="LDAPLookup" method="getValue" default="mydefault">
| | <parameter>foo.bar.prop</parameter>
| | </value-factory>
| | </property>
| |
|
Value factory can take as many parameters as it wants, and return whatever you implement.
What I meant was that LDAPLookup is something like this:
| public class LDAPLookup {
|
| public String getValue(String key, String default)
| {
| String value = LDAP.lookup(key);
| return value != null ? value : default;
| }
|
| }
|
So your version would just be:
| public class LDAPLookup {
|
| public String getValue(String key)
| {
| return getValue(key, null);
| }
|
| public String getValue(String key, String default)
| {
| String value = LDAP.lookup(key);
| return value != null ? value : default;
| }
|
| }
|
"adrian(a)jboss.org" wrote :
| We should probably still have the shorthand mechanism for simple one
| parameter methods.
|
|
| | <property name="x">
| | <value-factory bean="LDAPLookup" method="getValue" parameter="foo.bar.prop" default="mydefault"/>
| | </property>
| |
|
That sounds reasonable.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4066168#4066168
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4066168
18 years, 8 months