users@glassfish.java.net

Re: Getting Service Assemblies

From: jsexton0 <jsexton0_at_gmail.com>
Date: Thu, 12 Nov 2009 12:29:46 -0800 (PST)

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-tp26275172p26325806.html
Sent from the java.net - glassfish users mailing list archive at Nabble.com.