User: schaefera
Date: 02/03/23 18:25:05
Modified: src/main/org/jboss/management/mejb
ClientNotificationListener.java ManagementBean.java
RMIClientNotificationListener.java
Log:
Fixed a problem with the RMINotificationListener and wrong numbering of
the State in StateManageable found by Dirk Laessig (thanx).
Revision Changes Path
1.2 +6 -3
jboss-management/src/main/org/jboss/management/mejb/ClientNotificationListener.java
Index: ClientNotificationListener.java
===================================================================
RCS file:
/cvsroot/jboss/jboss-management/src/main/org/jboss/management/mejb/ClientNotificationListener.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ClientNotificationListener.java 11 Mar 2002 04:31:33 -0000 1.1
+++ ClientNotificationListener.java 24 Mar 2002 02:25:05 -0000 1.2
@@ -49,7 +49,7 @@
public ObjectName createListener(
MEJB pConnector,
- String mClass,
+ String pClass,
Object[] pParameters,
String[] pSignatures
) throws
@@ -57,14 +57,15 @@
ReflectionException,
MBeanRegistrationException,
MBeanException,
- NotCompliantMBeanException
+ NotCompliantMBeanException,
+ RemoteException
{
ObjectName lName = null;
while( lName == null ) {
try {
lName = new ObjectName( "JMX:type=listener,id=" + mRandom.nextLong() );
ObjectInstance lInstance = pConnector.createMBean(
- mClass,
+ pClass,
lName,
pParameters,
pSignatures
@@ -74,9 +75,11 @@
catch( InstanceAlreadyExistsException iaee ) {
lName = null;
}
+/* A remote exception could cause an endless loop therefore take it out
catch( RemoteException re ) {
lName = null;
}
+*/
}
mRemoteListener = lName;
return lName;
1.3 +6 -7
jboss-management/src/main/org/jboss/management/mejb/ManagementBean.java
Index: ManagementBean.java
===================================================================
RCS file:
/cvsroot/jboss/jboss-management/src/main/org/jboss/management/mejb/ManagementBean.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ManagementBean.java 14 Mar 2002 22:59:35 -0000 1.2
+++ ManagementBean.java 24 Mar 2002 02:25:05 -0000 1.3
@@ -52,21 +52,19 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Marc Fleury</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Andreas Schaefer</a>
-* @version $Revision: 1.2 $
+* @version $Revision: 1.3 $
*
* @ejb:bean name="MEJB"
* display-name="JBoss Management EJB (MEJB)"
* type="Stateless"
* jndi-name="ejb/mgmt/MEJB"
-* @--ejb:interface generate="none"
-* remote-class="javax.management.j2ee.Management"
* @ejb:interface extends="javax.management.j2ee.Management"
-* @--ejb:home extends="javax.management.j2ee.ManagementHome"
* @ejb:home generate="none"
* remote-class="javax.management.j2ee.ManagementHome"
* @ejb:env-entry description="JNDI-Name of the MBeanServer to be used to look it
up. If 'null' the first of all listed local MBeanServer is taken"
* name="Server-Name"
* value="null"
+* @ejb:transaction type="Supports"
*
**/
public class ManagementBean
@@ -143,7 +141,8 @@
try {
return new Integer(
queryNames(
- new ObjectName( getDefaultDomain() + ":*" )
+ new ObjectName( getDefaultDomain() + ":*" ),
+ null
).size()
);
}
@@ -228,10 +227,10 @@
*
* @ejb:interface-method view-type="remote"
**/
- public Set queryNames( ObjectName pName )
+ public Set queryNames( ObjectName pName, QueryExp pQuery )
throws RemoteException
{
- return mConnector.queryNames( pName, null );
+ return mConnector.queryNames( pName, pQuery );
}
/**
1.2 +15 -7
jboss-management/src/main/org/jboss/management/mejb/RMIClientNotificationListener.java
Index: RMIClientNotificationListener.java
===================================================================
RCS file:
/cvsroot/jboss/jboss-management/src/main/org/jboss/management/mejb/RMIClientNotificationListener.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- RMIClientNotificationListener.java 11 Mar 2002 04:31:33 -0000 1.1
+++ RMIClientNotificationListener.java 24 Mar 2002 02:25:05 -0000 1.2
@@ -43,12 +43,12 @@
{
super( pSender, pClientListener, pHandback );
// Export the RMI object to become a callback object
- UnicastRemoteObject.exportObject( this );
+ Remote lStub = UnicastRemoteObject.exportObject( this );
// Register the listener as MBean on the remote JMX server
createListener(
pConnector,
- "org.jboss.management.mejb.RMINotificationListener",
- new Object[] { this },
+ RMINotificationListener.class.getName(),
+ new Object[] { lStub },
new String[] { RMIClientNotificationListenerInterface.class.getName() }
);
addNotificationListener( pConnector, pFilter );
@@ -67,9 +67,17 @@
) throws
RemoteException
{
- mClientListener.handleNotification(
- pNotification,
- mHandback
- );
+ try {
+ mClientListener.handleNotification(
+ pNotification,
+ mHandback
+ );
+ }
+ catch( RuntimeException re ) {
+ throw new RemoteException( "Exceptions returned by the client listener",
re );
+ }
+ catch( Error e ) {
+ throw new RemoteException( "Error returned by the client listener", e );
+ }
}
}
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development