Deployed EJBs' count-programatically

J

Jaiganesh.K

Dear Group,

I am new to this group.
I have a thing to know how to find the count
of EJB's deployed in any server(Currently using JBoss)
using a code.

I also need to find out the number of session and entity
beans active and deployed too.

Hope to get a solution...

Regards,

Jaiganesh.K
 
J

Jaiganesh.K

Dear group,

I am new kid on the block.
I have a problem to solve.
Please give me a sample running EJB code
with Home/Remote and client code for just
printing the detail about Deployed EJBs,
Session bean count, Entity beans count.

I heard it is possible with below code snippet:

Context jndiContext = new InitialContext();
NamingEnumeration ne = jndiContext.list("");

while (ne.hasMore()) {
System.out.println("Object = " + ne.next());
}

This will list all the components deployed...
I want only the list of EJBs deployed.....

____________________________________________________
Please see the below details which i got too......
----------------------------------------------------

Re: List all EJBs deployed in an application server!!
Author: nrajasekhar Oct 19, 2004 12:46 AM (reply 3 of 5)


In your logic, why dont you try for using Object.isInstanceOf() to
check whether the objects returned by JNDI are EJBLocalHome/EJBHome.
Based on that we can find whether the object is EJB component or not.


Hope it willl work..

-----Rajasekhar


Re: List all EJBs deployed in an application server!!
Author: KPSeal Oct 19, 2004 5:51 AM (reply 4 of 5)


Another straightforward check is to have adopted a naming convention
in your JNDI tree. For example, all EJBS are under **/ejb. Obviously
this doesn't guarantee that your application server won't have whacked
something under there too - that's where the instanceof check will be
required.
Another alternative is to make calls to the appropriate MBeans in your
code - effectively doing what the JMX console does. Accessing MBeans
is pretty straightforward - typically you just look up the MBean
Server in JNDI and locate all relevant MBeans using a query. The
nature of the query will depend on the application server you're
using.
Hope this helps.


Re: List all EJBs deployed in an application server!!
Author: JSSunil2004 Oct 19, 2004 6:55 AM (reply 5 of 5)

That would be easy if the EJBs are accessed from the server that is
maintained by me.

But what about the servers that are not handled by me. they can give
any name to the JNDI context.

I did not understand anything on MBean. Could you help me with a code.


With Best Regards,

Jaiganesh.K

Bahwan Cybertek Pvt Ltd.,
Chennai, India
mobile : ++91 98400 92473

(e-mail address removed)
 
S

Sudsy

Jaiganesh.K said:
Dear group,

I am new kid on the block.
I have a problem to solve.
Please give me a sample running EJB code
with Home/Remote and client code for just
printing the detail about Deployed EJBs,
Session bean count, Entity beans count.

Okay, kid. Why should we give you a sample running EJB code?
A few questions, if you will:
- are you being paid to produce this code?
- if so, why can you not complete this assignment without
outside assistance?
- are you offering compensation?
- if not, why not?
- do you think that this ng is a free software factory?
- do you not think that most of us also have to put food
on the table at the end of day?
- have you made a first, valiant effort?
- have you posted your code and identified where your
knowledge is lacking?
- have you browsed the javadocs and identified all classes
which might lead you to a solution?
- have you availed yourself of the resources provided by
major search engines and located viable solutions?
If you haven't taken the first steps then this ng is likely
not where you will find satisfaction.
I profer no apologies if you take offence at this post. If you
"hang out your shingle" and proclaim to be a professional Java
(tm) programmer then you should know better.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,430
Messages
2,571,676
Members
48,796
Latest member
Greg L.

Latest Threads

Top