[Design of JBossCache] - Re: JBCACHE-1025: JBossCache mbean registration fails on Web
by JerryGauth
Good news. I was able to test this scenario on WebSphere today. It looks like the only thing we need to do in JBossCache is catch the registration error.
>From what I can see, WebSphere is doing the callback so cache.getServiceName() does return the actual registration name after the initial registration. This means that subsequent attempts to register the same instance will be detected. It also looks like deregistration of the cache mbean and interceptor mbeans works properly now (I need to verify again).
So the typical failure mode is as follows -
Someone in a standalone environment starts a cache instance using the default name (e.g., TreeCache-Group). On WebSphere, the instance is registered with a name like jboss.cache:service=TreeCache-Group, server=websphere....
If the same instance tries to register again, we use the actual registration name and detect that this is an attempt to register again.
If another instance (e.g., another standalone cache application) is then started and uses the default name, the code to detect a current registration won't detect that the name is already in use because it will use the default name (i.e., because serviceName is null at this point). The registration attempt will proceed and fail with the InstanceAlreadyExists exception because the actual name is already in use. So the fix is to simply catch the exception and report it as a warning.
Note that this doesn't change the JMX availability of the cache's mbean. The mbean is registered to the first client to use the name.
Unless I find anything further while looking at deregistration, I'll just fix this by handling the exception.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4038986#4038986
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4038986
18 years, 11 months
[Design of JBoss jBPM] - Re: Commands: Maybe result should be part of the Command-Obj
by camunda
I have found a workaround for my problem, so that we are not under a big time pressure any more...
Okay, returning a Map is also fine for all Use-Cases I think. If we really need the command in the result, we could build a CommandService which adds the Command to the Map ;-)
anonymous wrote :
| if (returnValue instanceof Map) ...
|
| or
|
| if (returnValue instanceof Hints) ...
|
I would prefer always return a Map and then
| if (resultMap.containsKey("myEnhancement"))
| ....
|
But thats a little detail then, I think.
SO if we agree on that, I will change all the Get...Command's to return a Map (GetProcessDefinition, GetProcessInstance, GEeTaskInstance, ...), because for them it is always possible that we also need the Logs or additional entities from the server (and only want to call once).
Okay?
anonymous wrote :
| i think it is the Command that should determine the return value and document that in the javadocs. the command service implementation should not do anything with the return value.
|
I think, the CommandService should not change the return value, but adding additional information (to the Map) is feasable I think. And very handy for some problems. You can also think of Interceptors (Spring or EJB 3, technic does not matter) adding informations. A AddProcessDiagramInterceptor, AddDetailedProcessLogsInterceptor, ....
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4038779#4038779
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4038779
18 years, 11 months