[jboss-user] [Microcontainer] - Re: migrating from ServiceMBeanSupport

2008-01-03 Thread jhalliday
Hmm, those bean entries don't get seen if they are in jboss-service.xml and 
putting them in the bootstrap means adding lots of new stuff to the classpath 
there.  That leaves the option of putting them in deploy, which probably means 
moving things that depend on the TransactionManager too i.e. the invokers. That 
goes rather beyond the scope I was originally envisaging, but it may be worth 
considering.

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4116682#4116682

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4116682
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Microcontainer] - Re: migrating from ServiceMBeanSupport

2008-01-02 Thread jhalliday
 You are missing the point and some code/xml

Yes, thanks Ales, the missing link seems to be the functionality in 
TestServiceControllerLifecycleCallback. I had assumed that declaring the 
annotation was sufficient, but it seems that nothing in the current AS trunk 
actually does anything with that annotation, or at least not at a sufficiently 
early stage in the lifecycle to be useful.

The code in TestServiceControllerLifecycleCallback is generic, not specific to 
the TransactionManager service. IMO it should be present in the AS, but I don't 
see it. Do I need to include it in the TS side of the integration module? To my 
mind the functionality should really be provided via bootstrap-beans, so in the 
xml for the TransactionManager I can simply reference the ServiceLifecycle bean 
rather than having to declare it first. Or perhaps one of the existing beans 
already has this functionality?

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4116405#4116405

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4116405
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Microcontainer] - Re: migrating from ServiceMBeanSupport

2008-01-02 Thread alesj
jhalliday wrote : ... but it seems that nothing in the current AS trunk 
actually does anything with that annotation, or at least not at a sufficiently 
early stage in the lifecycle to be useful.
  | 
  | IMO it should be present in the AS, but I don't see it.
What about this? ;-)
server\all\deployers\jboss-aop-jboss5.deployer\META-INF\jboss-aspect-library-beans.xml(16):
 class=org.jboss.system.microcontainer.jmx.ServiceControllerLifecycleCallback
server\default\deployers\jboss-aop-jboss5.deployer\META-INF\jboss-aspect-library-beans.xml(16):
 class=org.jboss.system.microcontainer.jmx.ServiceControllerLifecycleCallback

jhalliday wrote : 
  | To my mind the functionality should really be provided via bootstrap-beans, 
so in the xml for the TransactionManager I can simply reference the 
ServiceLifecycle bean rather than having to declare it first. Or perhaps one of 
the existing beans already has this functionality?
Read Adrian's comment once again. ;-)
The problem is really when AOP kicks in.
Too late for bootstrap beans.

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4116501#4116501

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4116501
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Microcontainer] - Re: migrating from ServiceMBeanSupport

2008-01-02 Thread jhalliday
Yes, I follow (but don't necessarily agree with) the argument that the 
TransactionManager should be in deploy, but given that we can't put it there in 
the short term we need an alternative solution.

Can the ServiceControllerLifecycleCallback stuff be moved such that it is 
available for use in the jboss-service.xml? To my mind it belongs not in the 
AOP deployer but in the bootstrap or early in the jboss-service.xml, so that 
services can make use of it. Otherwise as far as I can tell the 
TransactionManager is going to have to have its own duplicate of the same 
functionality, which seems less than elegant.

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4116511#4116511

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4116511
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Microcontainer] - Re: migrating from ServiceMBeanSupport

2008-01-02 Thread alesj
jhalliday wrote : Yes, I follow (but don't necessarily agree with) the 
argument that the TransactionManager should be in deploy, but given that we 
can't put it there in the short term we need an alternative solution.
  | 
I can port my test to be used in real use case.
I'll let you know when I'm done.

jhalliday wrote : 
  | Can the ServiceControllerLifecycleCallback stuff be moved such that it is 
available for use in the jboss-service.xml? To my mind it belongs not in the 
AOP deployer but in the bootstrap or early in the jboss-service.xml, so that 
services can make use of it. Otherwise as far as I can tell the 
TransactionManager is going to have to have its own duplicate of the same 
functionality, which seems less than elegant.
SCLC as such is a plain bean.
It's just the AOP that uses it, in the most transparent way.
Perhaps we can use two instances of it - one for direct MBeanExport, the other 
one via AOP and @JMX lookup.


View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4116526#4116526

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4116526
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Microcontainer] - Re: migrating from ServiceMBeanSupport

2008-01-02 Thread jhalliday
Hmm yes, that would work. All i'm trying to avoid is duplicating the java code. 
Duplicating a bit of xml bothers me a lot less. From the sounds of things it 
would be feasible to declare a bean with 
class=org.jboss.system.microcontainer.jmx.ServiceControllerLifecycleCallback in 
the jboss-service.xml file and inject the legacy JMX kernel into it, then 
reference that in the TransactionManager bean xml?

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4116530#4116530

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4116530
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Microcontainer] - Re: migrating from ServiceMBeanSupport

2008-01-02 Thread alesj
jhalliday wrote : From the sounds of things it would be feasible to declare a 
bean with 
class=org.jboss.system.microcontainer.jmx.ServiceControllerLifecycleCallback in 
the jboss-service.xml file and inject the legacy JMX kernel into it, then 
reference that in the TransactionManager bean xml?
Exactly.
This is what solves your problem:

  |bean name=MBeanExporter 
class=org.jboss.system.microcontainer.jmx.ServiceControllerLifecycleCallback
  |   property name=serviceControllerinject bean=JMXKernel 
property=serviceController//property
  |/bean
  | 
  |bean name=TransactionManager 
class=org.jboss.tm.RealTransactionManager
  |   
annotation@org.jboss.aop.microcontainer.aspects.jmx.JMX(name=jboss:service=TransactionManager,
 
exposedInterface=org.jboss.test.system.controller.integration.support.MockTransactionManagerMBean.class,
 registerDirectly=true)/annotation
  |   property name=transactionTimeout300/property
  |   property 
name=objectStoreDir${jboss.server.data.dir}/tx-object-store/property
  |   install bean=MBeanExporter method=install
  |  parameterinject fromContext=context//parameter
  |   /install
  |   uninstall bean=MBeanExporter method=uninstall
  |  parameterinject fromContext=context//parameter
  |   /uninstall
  |/bean
  | 
And since the AOP kicks in later, this bean won't be picked up twice for JMX 
registry - conclusion from Adrian's comment.

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4116533#4116533

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4116533
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Microcontainer] - Re: migrating from ServiceMBeanSupport

2007-12-21 Thread [EMAIL PROTECTED]
This is a known bug (really a configuration issue) currently in JBoss5.

The issue is that the AOP advice for @JMX is not installed until
after conf/jboss-service.xml or bootstrap-beans.xml is processed.

This is because it is done by the aop deployer which runs later.

http://www.jboss.com/index.html?module=bbop=viewtopict=125347

In general the implementation details (rather than the deployment layer)
like the transaction manager  should be in deploy anyway, 
\but there's lots of work to be done before that is possible. e.g.
http://www.jboss.com/index.html?module=bbop=viewtopict=112404
to properly define dependencies and make sure deployers are 
properly seperated from runtime infrastructure.

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4115034#4115034

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4115034
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Microcontainer] - Re: migrating from ServiceMBeanSupport

2007-12-19 Thread jhalliday
The JMX annotation seems a good approach at first, but when I replace the old 
mbean

  | mbean code=com.arjuna.ats.jbossatx.jta.TransactionManagerService
  |   name=jboss:service=TransactionManager
  |   attribute name=TransactionTimeout300/attribute
  |   attribute 
name=ObjectStoreDir${jboss.server.data.dir}/tx-object-store/attribute
  | /mbean
  | 
with the new annotated bean

  | bean name=TransactionManager 
class=com.arjuna.ats.jbossatx.jta.TransactionManagerService
  | 
annotation@org.jboss.aop.microcontainer.aspects.jmx.JMX(name=jboss:service=TransactionManager,
 
exposedInterface=com.arjuna.ats.jbossatx.jta.TransactionManagerServiceMBean.class,
 registerDirectly=true)/annotation
  | 
  | property name=TransactionTimeout300/property
  | property 
name=ObjectStoreDir${jboss.server.data.dir}/tx-object-store/property
  | /bean
  | 
then the dependent mbeans e.g.

  |mbean code=org.jboss.invocation.unified.server.UnifiedInvoker
  |   name=jboss:service=invoker,type=unified
  |   dependsjboss:service=TransactionManager/depends
  |   dependsjboss.remoting:service=Connector,transport=socket/depends
  |/mbean
fail to find the service they depend on:

  | ...
  | 14:01:46,883 INFO  [JMXKernel] Legacy JMX core initialized
  | 14:01:59,184 INFO  [WebService] Using RMI server codebase: 
http://127.0.0.1:8083/
  | 14:02:01,913 ERROR [ProfileServiceBootstrap] Failed to load profile: 
Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):
  | 
  | *** CONTEXTS MISSING DEPENDENCIES: Name - Dependency{Required State:Actual 
State}
  | 
  | jboss:service=invoker,type=jrmp
  |  - jboss:service=TransactionManager{Start:** NOT FOUND **}
  |  - jboss:service=TransactionManager{Create:** NOT FOUND **}
  | ...
  | *** CONTEXTS IN ERROR: Name - Error
  | 
  | jboss:service=TransactionManager - ** NOT FOUND **
  | 

Perhaps the annotation is being processed at a later stage of the lifecycle so 
it's not yet present when the mbean dependencies go to look for it?

Anyhow, it seems there are issues with interop between the old mbean style and 
the new bean style. My options at this point seem equally unpalatable: either 
link the transactions code again some new AS library (lots of work with no 
apparent advantage over the existing situation of linking against 
ServiceMBeanSupport) or convert everything that depends on the transaction 
manager from mbeans to beans also, transitively.  I vote for option 3: do 
nothing. ServiceMBeanSupport works ok, why bother with this new MC stuff?

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4114219#4114219

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4114219
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Microcontainer] - Re: migrating from ServiceMBeanSupport

2007-12-19 Thread alesj
You are missing the point and some code/xml - see 
jboss-aspect-library-beans.xml.

I've hacked together a JMXAnnotationTestCase for you in the 
AS5_trunk/system-jmx.
See the test class, and two matching xmls - JMXAnnotationTestCase.xml and 
JMXAnnotationTestCase-mc.xml.

It's all there, you just need to look better, and not whine over MC. ;-) 

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4114334#4114334

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4114334
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Microcontainer] - Re: migrating from ServiceMBeanSupport

2007-11-30 Thread jhalliday
 Why the mbean XML?

Umm, because I want operations on it exposed via. JMX?  Just because we use MC 
internally in the app server, that does not mean JMX goes away. There are still 
likely to be 3rd party tools wanting to use JMX to manage the server, so I need 
some way to wire the service up as an mbean. This seemed like the easiest 
route. If you can suggest another approach I'll happily change. Assuming of 
course I don't have to cascade the change to everything that depends on the tx 
manager and expects it to be an mbean.

Thanks

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4109168#4109168

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4109168
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Microcontainer] - Re: migrating from ServiceMBeanSupport

2007-11-30 Thread alesj
Check ServiceControllerLifecycleCallback in AS5_trunk.
And a lot of cluster beans use this 
@org.jboss.aop.microcontainer.aspects.jmx.JMX.
Or see EjbDeployer for non-xml usage.

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4109260#4109260

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4109260
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Microcontainer] - Re: migrating from ServiceMBeanSupport

2007-11-30 Thread alesj
@JMX? ;-)

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4109241#4109241

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4109241
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Microcontainer] - Re: migrating from ServiceMBeanSupport

2007-11-29 Thread jhalliday
Fair enough. So I can't do much of my setup in the service constructor, as I 
don't have the information yet at that time. I need to do the work in the start 
method instead. That's actually less effort for me, as it's how things 
currently work.

The problem with that is: many other services depend on the transaction 
manager. As far as I can tell, under the old pre-MC semantics, depends meant 
'ensure the other service has started'. As a result, work the transaction 
manager does in the start method would be finished before anything that depends 
on it was executed. Under MC, depends seems to mean 'ensure the service I 
depend on has reached at least the same point in the lifecycle as the one I'm 
transitioning to' by default.

As a result, some services are being instantiated and failing because they 
actually depend on the transaction manager having been started, not just 
created. Moving the work of transaction manager setup into its service 
constructor would have fixed that, but it's not an option. The only alternative 
I see is to change the depends clause of all the things that depend on the 
transaction manager, such that they explicitly require it to be started. That's 
somewhat less elegant than I was hoping for.

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4108833#4108833

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4108833
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Microcontainer] - Re: migrating from ServiceMBeanSupport

2007-11-29 Thread alesj
jhalliday wrote : Fair enough. So I can't do much of my setup in the service 
constructor, as I don't have the information yet at that time. I need to do the 
work in the start method instead. That's actually less effort for me, as it's 
how things currently work.
  | 
btw: what's stopping you from using MC beans instead of mbeans, if you're 
already migrating

jhalliday wrote : 
  | The problem with that is: many other services depend on the transaction 
manager. As far as I can tell, under the old pre-MC semantics, depends meant 
'ensure the other service has started'. As a result, work the transaction 
manager does in the start method would be finished before anything that depends 
on it was executed. Under MC, depends seems to mean 'ensure the service I 
depend on has reached at least the same point in the lifecycle as the one I'm 
transitioning to' by default.
  | 
Previous depend was/is like this:
A depends on B -- B created, then A could be created, B started, A could start
And this is still the same:
From ServiceDependencyMetaData

  |   visitor.addDependency(new LifecycleDependencyItem(name, other, 
ControllerState.CREATE));
  |   visitor.addDependency(new LifecycleDependencyItem(name, other, 
ControllerState.START));
  | 
From MC's AbstractDependencyMetaData

  |   DependencyItem item = new LifecycleDependencyItem(context.getName(), 
ControllerState.CREATE);
  |   visitor.addDependency(item);
  |   item = new LifecycleDependencyItem(context.getName(), 
ControllerState.START);
  |   visitor.addDependency(item);
  | 

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4108852#4108852

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4108852
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Microcontainer] - Re: migrating from ServiceMBeanSupport

2007-11-29 Thread jhalliday
ok, so I must be doing something wrong then. I take a class that previously 
extended ServiceMBeanSupport. I change it so it no longer does so. I change 
startService() to start(). I drop it into the app server and hey presto, thing 
that depend upon it break. 

12:29:28,517 INFO  [JMXKernel] Legacy JMX core initialized
12:29:41,350 INFO  [WebService] Using RMI server codebase: 
http://127.0.0.1:8083/
12:29:43,385 ERROR [AbstractKernelController] Error installing to Start: 
name=jboss:service=invoker,type=local state=Create mode=Manual 
requiredState=Installed
javax.naming.NameNotFoundException: TransactionManager not bound
at org.jnp.server.NamingServer.getBinding(NamingServer.java:542)
at org.jnp.server.NamingServer.getBinding(NamingServer.java:550)
at org.jnp.server.NamingServer.getObject(NamingServer.java:556)
at org.jnp.server.NamingServer.lookup(NamingServer.java:296)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:669)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:629)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at 
org.jboss.invocation.local.LocalInvoker.startService(LocalInvoker.java:77)
at 
org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:299)


If I'm reading that trace right, the name=jboss:service=invoker,type=local bean 
is being started and running into problems because start() has not jet been 
called on the transaction manager bean. I think there is some mismatch here 
between the lifecycle that occured under ServiceMBeanSupport. vs. the one I get 
with MC.

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4108862#4108862

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4108862
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Microcontainer] - Re: migrating from ServiceMBeanSupport

2007-11-29 Thread jhalliday
I don't have a createService/create method. Besides, the invoker bean is moving 
into the run state, which means the transaction manger should have had start() 
called on it? It does not seem to get that call. I can add a create() to see if 
that gets called, but I'm not clear what help that would be.

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4108865#4108865

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4108865
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Microcontainer] - Re: migrating from ServiceMBeanSupport

2007-11-29 Thread alesj
jhalliday wrote : I change it so it no longer does so. I change 
startService() to start(). 
What about createService() -- create()?

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4108863#4108863

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4108863
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Microcontainer] - Re: migrating from ServiceMBeanSupport

2007-11-29 Thread jhalliday
hmm, create() does not get called either. Is it possible there is something odd 
with lifecycle callbacks to mbeans?

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4108868#4108868

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4108868
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Microcontainer] - Re: migrating from ServiceMBeanSupport

2007-11-29 Thread alesj
Can you post this XML.

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4108872#4108872

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4108872
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Microcontainer] - Re: migrating from ServiceMBeanSupport

2007-11-29 Thread alesj
And an example of dependency?

Dunno how lifecycle works if your mbean is not an instance of Service anymore, 
or if it's wrapped in some Service impl ...


  |public void installAction(ServiceControllerContext context) throws 
Throwable
  |{
  |   Service service = context.getServiceProxy();
  |   service.start();
  | 
  |   context.getServiceContext().state = ServiceContext.RUNNING;
  | 
  |   ObjectName objectName = context.getObjectName();
  |   ServiceController serviceController = context.getServiceController();
  |   
serviceController.sendControllerNotification(ServiceMBean.START_EVENT, 
objectName);
  |}
  | 

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4108877#4108877

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4108877
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Microcontainer] - Re: migrating from ServiceMBeanSupport

2007-11-29 Thread jhalliday
   mbean name=jboss:service=TransactionManager 
code=com.arjuna.ats.jbossatx.jta.TransactionManagerService
  | property name=mbeanServerinject bean=JMXKernel 
property=mbeanServer//property
  | property name=transactionTimeout300/property
  | property 
name=ObjectStoreDir${jboss.server.data.dir}/tx-object-store/property
  |/mbean
  | 

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4108873#4108873

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4108873
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Microcontainer] - Re: migrating from ServiceMBeanSupport

2007-11-29 Thread jhalliday
 And an example of dependency? 

look at jboss-service.xml in AS trunk and take your pick.


  |mbean code=org.jboss.invocation.local.LocalInvoker
  |   name=jboss:service=invoker,type=local
  | dependsjboss:service=TransactionManager/depends
  |/mbean
  | 

 Dunno how lifecycle works if your mbean is not an instance of Service 
 anymore, 

huh? I thought the whole point of MC was that you could use POJOs. Now it 
appears I have to implement or subclass something? Arggg. How does that leave 
me any better off than not changing my code at all. I may as well stick with 
'extends ServiceMBeanSupport'



View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4108881#4108881

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4108881
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Microcontainer] - Re: migrating from ServiceMBeanSupport

2007-11-29 Thread alesj
jhalliday wrote : huh? I thought the whole point of MC was that you could use 
POJOs. Now it appears I have to implement or subclass something? Arggg. How 
does that leave me any better off than not changing my code at all. I may as 
well stick with 'extends ServiceMBeanSupport'
  | 
Define TM as MC bean, not as mbean, and you're done. ;-)
Why the mbean XML?

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4109099#4109099

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4109099
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Microcontainer] - Re: migrating from ServiceMBeanSupport

2007-11-28 Thread jhalliday
Thanks Ales

For the MBeanServer, I've opted to try injecting. That should work, but I can't 
figure out the correct xml.

mbean name=jboss:service=TransactionManager
  |  code=com.arjuna.ats.jbossatx.jta.TransactionManagerService
  |  constructor
  |  parameter type=javax.management.MBeanServer
  |inject bean=JMXKernel 
property=mbeanServer//parameter

does not work, the parameter elements are not seen. Scott suggested

arg type=javax.management.MBeanServerinject
  | bean=JMXKernel property=mbeanServer//arg

instead, which does not work either (Missing 'value' attribute in constructor 
arg).  That leaves me stuck, as I can't figure out the syntax for injecting to 
an attribute in the xml. 


For the notifications, there does not appear any way to specify what I want in 
xml. I'll either have to split my bean into two or link it against the event 
listener code.

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4108335#4108335

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4108335
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Microcontainer] - Re: migrating from ServiceMBeanSupport

2007-11-28 Thread [EMAIL PROTECTED]
Injection would be done via an attribute like:


  | mbean name=jboss:service=TransactionManager
  |  code=com.arjuna.ats.jbossatx.jta.TransactionManagerService
  | ...
  |   attribute name=MBeanServerinject bean=JMXKernel 
property=mbeanServer//attribute
  | 
  | /mbean
  | 


View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4108349#4108349

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4108349
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Microcontainer] - Re: migrating from ServiceMBeanSupport

2007-11-28 Thread jhalliday
Scott

That value is write once i.e. I want it set through the constructor, not 
exposed as a setter on the bean. Are you saying that's not possible currently?

Thanks

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4108364#4108364

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4108364
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Microcontainer] - Re: migrating from ServiceMBeanSupport

2007-11-28 Thread alesj
jhalliday wrote : Are you saying that's not possible currently?
  | 
Looking at the code:
 - 
http://anonsvn.jboss.org/repos/jbossas/trunk/system-jmx/src/main/org/jboss/system/metadata/ServiceMetaDataParser.java
looks like you currently cannot do injection with constructor (see 
parseConstructor method).

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4108629#4108629

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4108629
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Microcontainer] - Re: migrating from ServiceMBeanSupport

2007-11-27 Thread alesj
jhalliday wrote : 
  | The software is used standalone as well as in JBossAS. Internally we will 
continue to use MBeans as that's easiest for the standalone version. The 
JBossAS integration previously called  ServiceMBeanSupport.getServer() to get 
an MBeanServer for use internally. What is the equivalent call in MC (or AS5.0)?
  | 
MC is all about POJOs.
So there is no direct link to MBeanServer or other MC internals.
But you can simply get that injected - @Inject or via XML.
It's up to your bean. ;-)

jhalliday wrote : 
  | We previously used NotificationListener to register such that a method on 
our bean is invoked when some other bean (jboss.system:type=Server) entered a 
specified state (running).  Is there a way to wire such a thing in MC? It's not 
quite the same as requiring the other bean to be started before our bean. 
Indeed, such a solution is not viable as we must start earlier.  The 
BarrierController seems close to what I need but the example is old - is this 
functionality still present in MC? 
(http://wiki.jboss.org/wiki/Wiki.jsp?page=BarrierController)
  | 
You can use different dependency mechanisms. From the one's that already exist 
- depend, demand - or you can easily write your own.
Or there is also KernelEventListener - 
http://anonsvn.jboss.org/repos/jbossas/projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/spi/event/
 - if that's what suites you best.
e.g.

  | bean name=mybean class=org.jboss.acme.FooBar
  |demands state=Startjboss.system:type=Server/demand
  | /bean
  | 

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4108258#4108258

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4108258
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Microcontainer] - Re: migrating from ServiceMBeanSupport

2007-11-27 Thread alesj
In this e.g. case 'jboss.system:type=Server' must already be installed in order 
for 'mybean' demand dependency to be satisfied - to pass Start state.


View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4108269#4108269

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4108269
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user