wood burning stoves 2.0*
The moose likes JBoss/WildFly and the fly likes Accessing an HASingleton subclass Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Accessing an HASingleton subclass" Watch "Accessing an HASingleton subclass" New topic
Author

Accessing an HASingleton subclass

akhil achuthan
Ranch Hand

Joined: Mar 29, 2006
Posts: 69
Im using a clustered JBoss4.2.3GA environment. To attain the singleton behaviour im having a class say AppHA.java that extends org.jboss.ha.singleton.HASingletonSupport. As this is no normal java class it should not be correct to acess this class by creating a new instance using the new operator( new AppHA() ). Now how do I access a public custom method within this AppHA class?


Thanks in advance
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9329
    
110

How are you deploying that class? I mean, how does JBoss AS know, that it has to use that class?

[My Blog] [JavaRanch Journal]
akhil achuthan
Ranch Hand

Joined: Mar 29, 2006
Posts: 69
I have it configured it inside my jboss-service.xml within a .sar file. The snippet is given below.

<mbean code="net.test.app.akhil.init.ejb.ControlInitBean" name="jnpr.jmp:service=ControlInitBean,component=jive">
<depends>jboss.j2ee:module=inventory.jar,service=EJB3</depends>
</mbean>


Actually my ControlInitBean is a HASingletonSupport class.
akhil achuthan
Ranch Hand

Joined: Mar 29, 2006
Posts: 69
Got a reference over the net

http://community.jboss.org/wiki/WritingaClusteredHASingletonService

I could access the my HASingleton with this approach, but still have a problem. The hash codes printed within the startSingleton() and stopSingleton() are the same for a JVM lifecycle. But for the same lifecycle if I print the hashcode within my custom method that I access using the HA-JNDI lookup, I get a different has code printed. Coz of I doubt if am going the right way...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Accessing an HASingleton subclass
 
Similar Threads
IDE for J2ME
I'm a totally beginner
precompile JSPs in Tomcat 4.1
Doubt in Narrowing
Doubt in Narrowing