users@glassfish.java.net

Re: Getting Service Assemblies

From: jsexton0 <jsexton0_at_gmail.com>
Date: Thu, 12 Nov 2009 14:44:51 -0800 (PST)

This approach is a bust. Even when class issues are avoided, and although
this code works fine in a stand alone client, when put it in an mbean this
call:

JBIAdminCommandsClientFactory.getInstance(mBeanServer);

just dies. No exception is thrown, it just doesn't come back.

I'm not sure what to make of this. Is getting the status of an SA from an
MBean just a strange thing to want to do? There actually doesn't seem to be
a way to do this...


jsexton0 wrote:
>
> I came up with some code for to get SA information from an mbean, but I'm
> not sure it's the best method. I have a problem in putting this code in
> an mbean in that the JBI parser class, ServiceAssemblyInformationParser,
> is not available in that context. I'd have to move camshared.jar to
> Glassfish's classpath.
>
> Anyone have any comments about this?
>
> appserverConnectionSource = Connect.connectNoTLS("localhost", 8686,
> "admin",
> "adminadmin");
> mBeanServer = appserverConnectionSource.getMBeanServerConnection(false);
> jbiAdminCommands = JBIAdminCommandsClientFactory.getInstance(mBeanServer);
> String saXML = jbiAdminCommands.listServiceAssemblies("server");
> JBIServiceAssemblyStatusDocument saStatusDoc =
> ServiceAssemblyInformationParser.parse(saXML);
> List<JBIServiceAssemblyStatus> saStatusList =
> saStatusDoc.getJbiServiceAssemblyStatusList();
> Iterator saStatusListIterator = saStatusList.iterator();
> while (saStatusListIterator.hasNext())
> {
> JBIServiceAssemblyStatus saStatus = (JBIServiceAssemblyStatus)
> saStatusListIterator.next();
> //saStatus.getServiceAssemblyName()
> //saStatus.getStatus();
> }
>
>
>
> jsexton0 wrote:
>>
>> Hello -
>>
>> Does anyone know the way to get Service Assembly information using an
>> instance of com.sun.appserv.management.client.AppserverConnectionSource?
>>
>> I found various things through AppserverConnectionSource such as JNDI
>> values and JDBC pool settings, good stuff, but not SA information.
>>
>> In addition, I can get EJB information, but getEnabled() seems to return
>> true on an EJB even when I disable it. Which is to say:
>>
>> Map<String, EJBModuleConfig> ejbModuleConfigMap =
>> domainConfig.getEJBModuleConfigMap();
>> Iterator EJBModuleConfigIterator =
>> ejbModuleConfigMap.entrySet().iterator();
>> while (EJBModuleConfigIterator.hasNext()) {
>> Map.Entry entry = (Map.Entry) EJBModuleConfigIterator.next();
>> EJBModuleConfig ejbModuleConfig =
>> ejbModuleConfigMap.get(entry.getKey());
>>
>> ejbModuleConfig.getEnabled() // Always returns true??
>>
>>
>> Thanks!
>>
>
>

-- 
View this message in context: http://old.nabble.com/Getting-Service-Assemblies-tp26275172p26327919.html
Sent from the java.net - glassfish users mailing list archive at Nabble.com.