[Beginners Corner] - Scoping classes
by editha
In chapter 2 of the jboss application server guide, i found the following sentence concerning scoped classloading:
"With deployment based scoping, each deployment creates its own class loader repository in the form of a HeirarchicalLoaderRepository3 that looks first to the UnifiedClassLoader3 instances of the deployment units included in the EAR before delegating to the default UnifiedLoaderRepository3."
I am afraid I do not really understand this. What exactly does "HeirarchicalLoaderRepository3 that looks first to the UnifiedClassLoader3 instances of the deployment units included in the EAR" mean?
May I create my own UnifiedClassLoader3 instance that is then used? Where do i generate that instance? Anywhere in a java class of that ear?
Is it even possible to use my own custom classloader which extends UnifiedClassLoader3?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3991936#3991936
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3991936
19 years, 4 months
[EJB 3.0] - Re: MBean as NotificationBroadcaster
by bergander
I am not experiencing the "The MBean named exists but does not implement the NotificationBroadcaster interface"-error that you get as long as I specify the mbean and not the management interface (type=Management) as a broadcaster.
But my problem is that although the log files tells me that my broadcaster has been subscribed to by the listener, the listener does not receive any notifications.
After some investigation I found out that when using a ListenerServiceMBeanSupport together with a SubscriptionList configuration to subscribe to notifications sent by an EJB3 service bean it seems like the ListenerServiceMBeanSupport bean subscribes to the ServiceDelegateWrapper class instead of the defined bean in the SubscriptionList.
To work around this the following code could be added to the ServiceDelegateWrapper class:
| @Override
| public void addNotificationListener(NotificationListener listener,
| NotificationFilter filter,
| Object handback)
| {
|
| if (delegate instanceof ServiceContainer)
| {
| try
| {
| ((ServiceContainer) delegate).invoke("addNotificationListener",
| new Object[] {listener, filter, handback},
| new String[] {"javax.management.NotificationListener",
| "javax.management.NotificationFilter",
| "java.lang.Object"});
|
| }
| catch (Exception e)
| {
| throw new RuntimeException(e);
| }
| }
| }
|
| @Override
| public void removeNotificationListener(NotificationListener listener,
| NotificationFilter filter,
| Object handback)
| {
|
| if (delegate instanceof ServiceContainer)
| {
| try
| {
| ((ServiceContainer) delegate).invoke("removeNotificationListener",
| new Object[] {listener, filter, handback},
| new String[] {"javax.management.NotificationListener",
| "javax.management.NotificationFilter",
| "java.lang.Object"});
|
| }
| catch (Exception e)
| {
| throw new RuntimeException(e);
| }
| }
| }
|
This has been tested with the 4.0.5 GA release and it seems to work fine. Is this a good way of solving this? Any other suggestions?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3991916#3991916
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3991916
19 years, 4 months