You are viewing a plain text version of this content. The canonical link for it is here.
Posted to muse-user@ws.apache.org by Daniel Jemiolo <da...@us.ibm.com> on 2007/08/10 18:53:18 UTC

Re: PullPoint subscriptions - PublishAllMessagesFilter and statics in AbstractIsolationLayer


"Bug free" is a stretch, but thanks anyway.  ;)

As I recall, AbstractIsolationLayer started out as a normal class and was
changed to be static because of problems we had setting the class loading
scope on various SOAP engines. Long ago, when we just ran on Axis 1.x, we
used its service scope (request|application|...) to make it so the service
stayed loaded for as long as the server was up; for whatever reason,
expanding to Axis2, the mini SOAP engine, WebSphere, etc., led to some
inconsistency and making things static was the only way to ensure we got
the proper behavior. Otherwise, the Muse engine would reload for each
request, which is obviously a bad thing.

It's odd that you're seeing the static class behavior even after shutting
down the app and restarting - I thought that this would cause the app
server to unload the app's local classloader. Are all of your Muse JARs in
the web app's /WEB-INF/lib, or have you added them to one of the server's
common library directories?

Dan



<Ch...@swisscom.com> wrote on 07/25/2007 11:14:54 AM:

> Hi All,
>
> First off I find Muse to be incredibly well designed software and mostly
> bug free, got to say I'm extremely impressed (especially when coupled
> with TPTP).
>
> However both I; and Marjan Sterjev; note that you need the first
> subscription to get a reference from the producer.  This then receives
> all of the messages sent on that wsresource.  I agree that this is the
> incorrect approach according to the specs (and expectations).
>
> Whilst this isn't meant as a patch to the muse code, the following
> implementations will only collect the messages subscribed to (at least
> in my tests).  If they help Marjan and others that's cool, sample code
> use below.
>
> First question: in the PullPoint accept method I just return true, based
> on the assumption that the router will only send Notify to this resource
> instance if it was the target of a subscription (from the WSA header to
> and resource param).  Is this assumption correct?
>
> Second question: was there a design decision behind the use of statics
> in AbstractIsolationLayer?  As is the default won't retrieve a new
> environment if it is shutdown then restarted again (in my case this
> requires a new environment to be created).  I have simply implemented
> IsolationLayer with copy+paste and got rid of the statics, will this
> likely cause any issues (hence the question of design decision, maybe
> there is something I'm not seeing)?
>
> TIA and cheers,
> Chris
>
> PS (The reason why these do not derive is because the simplepullpoint
> shutdown code won't work when there isn't a subscription)
> PPS (many thanks for this great software)
>
> Code used as (where adapterStatus implements pullpoints and
> immediateresourcetermination):
>
>       EndpointReference source = new EndpointReference(new
> URI("source://tests"));
>       EndpointReference target = new EndpointReference(new
> URI("target://some/uri"));
>
>       adapterStatusProxy resource = new adapterStatusProxy(
> target, source, new SimpleSoapClient());
>
>       Element el = resource.createPullPoint();
>       EndpointReference pullpoint = new EndpointReference(el);
>
>       // register a consumer.
>       SubscriptionClient client =
> resource.subscribe(pullpoint, new
> TopicFilter(LogLevelCapability.LEVELCHANGED_TOPIC_NAME), null);
>
>       // should only get once per each change (seperate
> notify)
>       resource.updatelogLevel("info");
>       resource.updatelogLevel("debug");
>       resource.updatelogLevel("info");
>
>       // run in another thread so we'll have to wait a while..
>       try {
>          Thread.sleep(1000);
> //         System.in.read();
>       } catch (Exception e) {
>       }
>
>       // get the messages?
>       Element max =
> XmlUtils.createElement(el.getOwnerDocument(), new
> QName("http://docs.oasis-open.org/wsn/b-2", "MaximumNumber", "pfx0"),
> new Integer(10));
>
>       adapterStatusProxy pullit = new adapterStatusProxy(
> pullpoint, source, new EsbSoapClient(new ProxyHelper(adapter)
>       , DispatchContext.ESB_TESTS));
>
>       Element[] res = pullit.getMessages(max);
>       client.destroy();
>
>       pullit.destroy();
>       assertEquals(3, res.length); // property change
> notification as well would be 6
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: muse-user-help@ws.apache.org

RE: PullPoint subscriptions - PublishAllMessagesFilter and statics in AbstractIsolationLayer

Posted by Ch...@swisscom.com.
After fighting with Axis 1.4 for almost a month to get a stable level
2.0 DOM and saaj (that works with WSS4J etc) its very refreshing to not
have to fight software to extend it.  The worst I've had to do with Muse
is copy and paste one class to get rid of the statics.

The explanation makes sense.  In our case I'm integrating muse as a
management layer into our inhouse ESB.  We need to be able to
restart/reload the services at runtime without loss of service, the
SoapClient/Environment in particular is tied to an instance of the ESB
(allowing sending to MQ etc instead of just http).  The statics then
showed up as exceptions when trying to use the first initial
environment.

Given the background I think its fine to just use non-statics.

Regarding:

> First question: in the PullPoint accept method I just return true, 
> based on the assumption that the router will only send Notify to this 
> resource instance if it was the target of a subscription (from the WSA

> header to and resource param).  Is this assumption correct?

Is this ok to assume?  The pullpoint is a new resource so I think it
must be but I wanted to check.  If so I'd raise a jira to have the
default PullPoint implementation changed to this model (or at least
provide the alternatives :-).

cheers,
Chris

-----Original Message-----
From: Daniel Jemiolo [mailto:danjemiolo@us.ibm.com] 
Sent: Friday, August 10, 2007 6:53 PM
To: muse-user@ws.apache.org
Subject: Re: PullPoint subscriptions - PublishAllMessagesFilter and
statics in AbstractIsolationLayer



"Bug free" is a stretch, but thanks anyway.  ;)

As I recall, AbstractIsolationLayer started out as a normal class and
was changed to be static because of problems we had setting the class
loading scope on various SOAP engines. Long ago, when we just ran on
Axis 1.x, we used its service scope (request|application|...) to make it
so the service stayed loaded for as long as the server was up; for
whatever reason, expanding to Axis2, the mini SOAP engine, WebSphere,
etc., led to some inconsistency and making things static was the only
way to ensure we got the proper behavior. Otherwise, the Muse engine
would reload for each request, which is obviously a bad thing.

It's odd that you're seeing the static class behavior even after
shutting down the app and restarting - I thought that this would cause
the app server to unload the app's local classloader. Are all of your
Muse JARs in the web app's /WEB-INF/lib, or have you added them to one
of the server's common library directories?

Dan



---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org