[Design of POJO Server] - Re: bean/mbean integration issue
by alesj
"adrian(a)jboss.org" wrote :
| To what? Again this should probably be a seperate interface that can be
| optionally implemented.
|
| That a context has an associated classloader is true for JMX
| and sort of true for POJO (there is no first class support like the MBeanServer methods)
| But is this really true of all contexts of a state machine?
|
So we should split DispatchContext into simple get/set interface and 'advanced' interface with invoke, target, classloader.
Since how else would you get the parameters and signatures?
| protected Object invoke(KernelConfigurator configurator, DispatchContext context, String name, List<ParameterMetaData> params) throws Throwable
| {
| String[] signature;
| Object[] parameters;
| if (params == null || params.isEmpty())
| {
| signature = new String[0];
| parameters = new Object[0];
| }
| else
| {
| int size = params.size();
| signature = Configurator.getParameterTypes(log.isTraceEnabled(), params);
| Object target = context.getTarget();
| // TODO - is this ok for non-POJO targets?
| if (target != null)
| {
| MethodInfo methodInfo = Configurator.findMethodInfo(configurator.getClassInfo(target.getClass()), name, signature);
| parameters = Configurator.getParameters(log.isTraceEnabled(), context.getClassLoader(), methodInfo.getParameterTypes(), params);
| // add some more info, if not yet set
| for(int j = 0; j < size; j++)
| {
| if (signature[j] == null)
| {
| signature[j] = methodInfo.getParameterTypes()[j].getName();
| }
| }
| }
| else
| {
| parameters = new Object[size];
| ClassLoader classLoader = context.getClassLoader();
| for (int i = 0; i < size; i++)
| {
| ParameterMetaData pmd = params.get(i);
| TypeInfo typeInfo = null;
| if (signature[j] != null)
| {
| typeInfo = configurator.getClassInfo(signature[j], classLoader);
| }
| // typeInfo might be null, but we can still get value in some cases
| parameters[j] = pmd.getValue().getValue(typeInfo, classLoader);
| }
|
| }
| }
| return context.invoke(name, parameters, signature);
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4002911#4002911
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4002911
19 years, 2 months
[Design of POJO Server] - Re: bean/mbean integration issue
by adrian@jboss.org
"alesj" wrote :
| I did make it to extend ControllerContext. I need the target and I thought I needed name. Should I make it plain 'standalone'?
|
It should be a seperate optional interface that a context can implement.
Not all contexts will have/need a notion of "dispatch".
anonymous wrote :
| I also added getClassLoader() method - to help me with getting the param TypeInfos.
To what? Again this should probably be a seperate interface that can be
optionally implemented.
That a context has an associated classloader is true for JMX
and sort of true for POJO (there is no first class support like the MBeanServer methods)
but is this really true of all contexts of a state machine?
Remember the dependency project is intended to be just a model
of state transitions governed by their dependencies.
The other part, i.e. what those transitions means and additional state/methods
is a property of the implementation projects.
But, that doesn't mean that the dependency project can't define optional
interfaces to allow contexts to provide add-on behaviour that
cross cuts the different implementations.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4002891#4002891
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4002891
19 years, 2 months