Re: [aspectwerkz-user] Re: Re: Re: re[aspectwerkz-user] mote weaving?

"Alexandre Vasseur" <[email protected]> Mon, 27 Oct 2008 23:10:23 +0100
Newsgroups gmane.comp.java.aspectwerkz.user
Message-ID <[email protected]>
------=_Part_52618_30170547.1225145423714
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

online (or runtime) weaving (or dynamic AOP) means weaving when the app is
running and from within the same JVM - in our wording. Often re-weaving is
mimic by simple addition / removal of aspects at pre-determined joinpoints
that have previously been weaved.

The javaagent option does not requires socket or whatever. It is a standard
java (not AOP or whatever related) in java 5+ that can help do class load
time bytecode instrumentation and re-instrumentation. Please don't mix this
one with the aspectwerkz/bin scripts at all.

So steps with AspectWerkz for runtime weaving are:
- add aspectwerkz jar and deps. to your path as per doc
- prepare your jvm startup script for javaagent option use, with proper
syntax for AspectWerkz as in the doc (I think there is a section about this=
)
- prepare your AspectWerkz xml file for runtime weaving (ie here mostly
declare pre-determined set of joinpoints)
- compile your app, all your aspects, and put everything in the classpath
- start the app. Weaving will happen at class loadtime thanks to javaagent =
+
xml and aspects that are known (if any, in the xml) will be put in place
- if you want to add/remove an already compiled aspect that is already
available in the classpath at runtime from within the app and apply it to
the set of pre-determined joinpoints you add declared in the xml, then have
your app call the AspectWerkz API for that

I really don't have bandwith to advise further. You may well have a look at
the entire source and the test suite in the project if you don't manage to
get it working.
Alex

On Mon, Oct 27, 2008 at 10:49 PM, neo anderson <[email protected]=
k
> wrote:

>
> I think I am still confused with the term online weaving.
>
> - How can I send aspect to the (targeted) running process (because hot
> deployment required to run in the same JVM)?
>
> - Do I need to startup the target application with socket opened?
>
> Because when using -javaagent option, the terminal throws message
>
> Error occurred during initialization of VM
> agent library failed to init: instrument
> failed to attach to VM (dt_socket, 9300):
> java.net.ConnectException: Connection refused
>        at java.net.PlainSocketImpl.socketConnect(Native Method)
>        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
>        at
> java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
>        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
>        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
>        at java.net.Socket.connect(Socket.java:519)
>        at
>
> com.sun.tools.jdi.SocketTransportService.attach(SocketTransportService.ja=
va:204)
>        at
>
> com.sun.tools.jdi.GenericAttachingConnector.attach(GenericAttachingConnec=
tor.java:98)
>        at
>
> com.sun.tools.jdi.SocketAttachingConnector.attach(SocketAttachingConnecto=
r.java:72)
>        at
>
> org.codehaus.aspectwerkz.hook.ClassLoaderPatcher.hotswapClassLoader(Class=
LoaderPatcher.java:205)
>        at
> org.codehaus.aspectwerkz.hook.ProcessStarter.run(ProcessStarter.java:201)
>        at
> org.codehaus.aspectwerkz.hook.ProcessStarter.main(ProcessStarter.java:271=
)
>
> The way how I run the application is
>
> 1st, starting the target application by `java -classpath target sys.Serve=
r`
> 2nd, run the hot deployment `$ASPECTWERKZ_HOME/bin/aspectwerkz
> -javaagent:$ASPECTWERKZ_HOME/lib/aspectwerkz-core-2.0.jar -cp
>
> "./:target:$ASPECTWERKZ_HOME/lib/aspectwerkz-2.0.jar:$ASPECTWERKZ_HOME/li=
b/aspectwerkz-core-2.0.jar:$ASPECTWERKZ_HOME/lib/aspectwerkz-extensions-2.0=
.jar"
> action.Detector 1`
>
> This looks incorrect, but I completely have no idea where goes wrong.
>
> Would you please to give me advice?
>
> I really appreciate your help.
>
>
> Alexandre Vasseur wrote:
> >
> > please consider using the javaagent option. That is the best option to
> > consider in Java 5 / java 6.
> >
> > On Sun, Oct 26, 2008 at 2:24 PM, neo anderson
> > <[email protected]>wrote:
> >
> >>
> >> After trying several times, I still can not get the online weaving
> >> worked.
> >> I
> >> think there are several things I still do not understand very well.
> >>
> >> Mainly it is 'What is the correct way (scenario) to execute the online
> >> weaving?'
> >>
> >> From the document at http://aspectwerkz.codehaus.org/downloads/ saying
> >> that,
> >> e.g. in transparent bootclasspath mode, running bin/aspectwerkz the
> first
> >> JVM  will launch the application JVM. However, if I switch to run
> >> `$ASPECTWERKZ_HOME/bin/aspectwerkz -cp
> >>
> >>
> "./:target:$ASPECTWERKZ_HOME/lib/aspectwerkz-2.0.jar:$ASPECTWERKZ_HOME/li=
b/aspectwerkz-core-2.0.jar:$ASPECTWERKZ_HOME/lib/aspectwerkz-extensions-2.0=
.jar"
> >> action.Detector 1`
> >>
> >> The output will shows some extra information
> >>
> >> java ... -Xrunjdwp:transport=3Ddt_socket,suspend=3Dy,address=3D9300,se=
rver=3Dy
> >> -Xdebug -Xbootclasspath/p ...
> >> ...
> >> Listening for transport dt_socket at address: 9300
> >> Listening for transport dt_socket at address: 9300
> >> AspectWerkz - INFO - Pre-processor
> >> org.codehaus.aspectwerkz.transform.AspectWerkzPreProcessor loaded and
> >> initialized
> >> Enable aspect! ...
> >> Deployer::INFO - deploying aspect [aspect.Observer] in class loader
> >> sun.misc.Launcher$AppClassLoader@17182c1]
> >>
> >> but still there is no aop information weaved to the running server.
> >>
> >> Would you please to give me some advice or hints? (Sorry for this newb=
ie
> >> question)
> >>
> >> Thanks again for the help. I appreciate it.
> >>
> >>
> >> Alexandre Vasseur wrote:
> >> >
> >> > hot deployment MUST be in the same VM yes. Think deployment (of new
> >> aspect
> >> > but whose compiled code is already available) as a "runtime weaving"
> >> > Amex
> >> >
> >> > On Sun, Oct 19, 2008 at 10:50 PM, neo anderson
> >> > <[email protected]
> >> >> wrote:
> >> >
> >> >>
> >> >>
> >> >> I follow the example at
> >> >>
> >> >>
> >>
> http://blogs.codehaus.org/people/jboner/archives/000913_aspect_hot_deploy=
ment_in_practice_implementing_a_jmx_monitoring_aspect_.html
> >> >> to do hot deployment, but it fails. There is no error returned to t=
he
> >> >> screen. It only prints message like:
> >> >>
> >> >> Deployer::INFO - deploying aspect [aspect.Observer] in class loader
> >> >> sun.misc.Launcher$AppClassLoader@1a16869]
> >> >>
> >> >> The target application does not print out anything.
> >> >>
> >> >> The code to do deployment is
> >> >>
> >> >> package action;
> >> >>
> >> >> public class Detector{
> >> >>
> >> >> ...
> >> >>        void detect(){
> >> >>                System.out.println("Enable aspect! ...");
> >> >>                Deployer.deploy(Observer.class, toXML());
> >> >>        }
> >> >> ...
> >> >>        private String toXML(){
> >> >>                return "<aspect class=3D\"Observer\"><pointcut
> >> >> name=3D\"count\"
> >> >> expression=3D\"execution(* sys.Server.count(..))\"/></aspect>";
> >> >> /* //this xml throws not well formed xml definition exception
> >> >>                return "<aspectwerkz>\n" +
> >> >>                        "<system id=3D\"Mock Server\">\n"+
> >> >>                        "       <package name=3D\"aspect\">\n"+
> >> >>                        "               <aspect
> class=3D\"Observer\">\n"+
> >> >>                        "                       <pointcut
> >> name=3D\"count\"
> >> >> expression=3D\"execution(* sys.Server.count(..))\"/>\n"+
> >> >>                        "                       <advice
> >> >> name=3D\"beforeCount\"
> >> >> type=3D\"before\" bind-to=3D\"count\"/>\n"+
> >> >>                        "                       <advice
> >> >> name=3D\"afterCount\"
> >> >> type=3D\"after\" bind-to=3D\"count\"/>\n"+
> >> >>                        "               </aspect>\n"+
> >> >>                        "       </package>\n"+
> >> >>                        "       </system>\n"+
> >> >>                        "</aspectwerkz>\n";
> >> >> */
> >> >>        }
> >> >>
> >> >> Where the Observer.java aspect and the application (Server.java) to
> be
> >> >> weaved is the same as
> >> >> http://www.nabble.com/Runtime-weaving-question-to20042123.html
> >> >>
> >> >> The way to test runtime weaving scenario is
> >> >> 1.) launch the server
> >> >> 2.) deploy the aspect by `java -cp
> >> >>
> >> >>
> >>
> "target:$ASPECTWERKZ_HOME/lib/aspectwerkz-2.0.jar:$ASPECTWERKZ_HOME/lib/a=
spectwerkz-core-2.0.jar:$ASPECTWERKZ_HOME/lib/aspectwerkz-extensions-2.0.ja=
r"
> >> >> action.Detector 1`
> >> >>
> >> >> I also have a look at the example in jdk15/test folder, in which it
> >> seems
> >> >> like the hot deployment is done on the same jvm, e.g.
> >> >>
> >> >> public class HotDeployedTest ...
> >> >>   public void testDeployment() {
> >> >> ...
> >> >>     Deployer.deploy(HotdeployableAspect.class);
> >> >>        target();
> >> >> ...
> >> >>
> >> >> I think I have done something wrong, but do not know where it is.
> >> Would
> >> >> anyone please give me some hint or advice?
> >> >>
> >> >> Thank you very much,
> >> >>
> >> >>
> >> >>
> >> >>
> >> >>
> >> >> Jonas Bon=E9r-3 wrote:
> >> >> >
> >> >> > Yes it is possible, but you will have to define a so-called
> >> >> > 'deployment scope' and preweave the classes (will just add tiny
> >> hooks,
> >> >> > but no aspects). Then you can do hot deploy and undeploy in a
> >> running
> >> >> > system.
> >> >> > Details here:
> >> >> >
> >> >>
> >>
> http://aspectwerkz.codehaus.org/new_features_in_2_0.html#Hot_deployment_a=
nd_undeployment_of_aspects
> >> >> >
> >> >> > /Jonas
> >> >> >
> >> >> > On 10/3/07, Dongkwan Kim <[email protected]> wrote:
> >> >> >> Does AspectWerkz support the remote weaving? Let me explain my
> >> >> scenario
> >> >> >> in
> >> >> >> detail.
> >> >> >> Suppose there is a running Java application. It don't know
> >> >> AspectWerkz.
> >> >> I
> >> >> >> want to insert an aspect into the running application. This is
> >> called
> >> >> the
> >> >> >> remote weaving. Is there any way to weave already running Java
> >> >> classes?
> >> >> >>
> >> >> >> DK
> >> >> >>
> >> >> >
> >> >> >
> >> >> > --
> >> >> > Jonas Bon=E9r
> >> >> >
> >> >> > http://jonasboner.com
> >> >> >
> >> >> >
> >> >>
> >> >> --
> >> >> View this message in context:
> >> >> http://www.nabble.com/remote-weaving--tp13025650p20060099.html
> >> >> Sent from the AspectWerkz - User mailing list archive at Nabble.com=
.
> >> >>
> >> >>
> >> >> -------------------------------------------------------------------=
--
> >> >> To unsubscribe from this list, please visit:
> >> >>
> >> >
> >> >>    http://xircles.codehaus.org/manage_email
> >> >>
> >> >>
> >> >>
> >> >
> >> >
> >>
> >> --
> >> View this message in context:
> >> http://www.nabble.com/remote-weaving--tp13025650p20173427.html
> >> Sent from the AspectWerkz - User mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe from this list, please visit:
> >>
> >>    http://xircles.codehaus.org/manage_email
> >>
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/remote-weaving--tp13025650p20197173.html
> Sent from the AspectWerkz - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>

------=_Part_52618_30170547.1225145423714
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

online (or runtime) weaving (or dynamic AOP) means weaving when the app is =
running and from within the same JVM - in our wording. Often re-weaving is =
mimic by simple addition / removal of aspects at pre-determined joinpoints =
that have previously been weaved.<br>
<br>The javaagent option does not requires socket or whatever. It is a stan=
dard java (not AOP or whatever related) in java 5+ that can help do class l=
oad time bytecode instrumentation and re-instrumentation. Please don&#39;t =
mix this one with the aspectwerkz/bin scripts at all.<br>
<br>So steps with AspectWerkz for runtime weaving are:<br>- add aspectwerkz=
 jar and deps. to your path as per doc<br>- prepare your jvm startup script=
 for javaagent option use, with proper syntax for AspectWerkz as in the doc=
 (I think there is a section about this)<br>
- prepare your AspectWerkz xml file for runtime weaving (ie here mostly dec=
lare pre-determined set of joinpoints)<br>- compile your app, all your aspe=
cts, and put everything in the classpath<br>- start the app. Weaving will h=
appen at class loadtime thanks to javaagent + xml and aspects that are know=
n (if any, in the xml) will be put in place<br>
- if you want to add/remove an already compiled aspect that is already avai=
lable in the classpath at runtime from within the app and apply it to the s=
et of pre-determined joinpoints you add declared in the xml, then have your=
 app call the AspectWerkz API for that<br>
<br>I really don&#39;t have bandwith to advise further. You may well have a=
 look at the entire source and the test suite in the project if you don&#39=
;t manage to get it working.<br>Alex<br><br><div class=3D"gmail_quote">On M=
on, Oct 27, 2008 at 10:49 PM, neo anderson <span dir=3D"ltr">&lt;<a href=3D=
"mailto:[email protected]">[email protected]</a>&gt;<=
/span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"border-left: 1px solid rgb(204, =
204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
I think I am still confused with the term online weaving.<br>
<br>
- How can I send aspect to the (targeted) running process (because hot<br>
deployment required to run in the same JVM)?<br>
<br>
- Do I need to startup the target application with socket opened?<br>
<br>
Because when using -javaagent option, the terminal throws message<br>
<br>
Error occurred during initialization of VM<br>
agent library failed to init: instrument<br>
failed to attach to VM (dt_socket, 9300):<br>
java.net.ConnectException: Connection refused<br>
 &nbsp; &nbsp; &nbsp; &nbsp;at java.net.PlainSocketImpl.socketConnect(Nativ=
e Method)<br>
 &nbsp; &nbsp; &nbsp; &nbsp;at java.net.PlainSocketImpl.doConnect(PlainSock=
etImpl.java:333)<br>
 &nbsp; &nbsp; &nbsp; &nbsp;at<br>
java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)<br>
 &nbsp; &nbsp; &nbsp; &nbsp;at java.net.PlainSocketImpl.connect(PlainSocket=
Impl.java:182)<br>
 &nbsp; &nbsp; &nbsp; &nbsp;at java.net.SocksSocketImpl.connect(SocksSocket=
Impl.java:366)<br>
 &nbsp; &nbsp; &nbsp; &nbsp;at java.net.Socket.connect(Socket.java:519)<br>
 &nbsp; &nbsp; &nbsp; &nbsp;at<br>
com.sun.tools.jdi.SocketTransportService.attach(SocketTransportService.java=
:204)<br>
 &nbsp; &nbsp; &nbsp; &nbsp;at<br>
com.sun.tools.jdi.GenericAttachingConnector.attach(GenericAttachingConnecto=
r.java:98)<br>
 &nbsp; &nbsp; &nbsp; &nbsp;at<br>
com.sun.tools.jdi.SocketAttachingConnector.attach(SocketAttachingConnector.=
java:72)<br>
 &nbsp; &nbsp; &nbsp; &nbsp;at<br>
org.codehaus.aspectwerkz.hook.ClassLoaderPatcher.hotswapClassLoader(ClassLo=
aderPatcher.java:205)<br>
 &nbsp; &nbsp; &nbsp; &nbsp;at<br>
org.codehaus.aspectwerkz.hook.ProcessStarter.run(ProcessStarter.java:201)<b=
r>
 &nbsp; &nbsp; &nbsp; &nbsp;at<br>
org.codehaus.aspectwerkz.hook.ProcessStarter.main(ProcessStarter.java:271)<=
br>
<br>
The way how I run the application is<br>
<br>
1st, starting the target application by `java -classpath target sys.Server`=
<br>
2nd, run the hot deployment `$ASPECTWERKZ_HOME/bin/aspectwerkz<br>
-javaagent:$ASPECTWERKZ_HOME/lib/aspectwerkz-core-2.0.jar -cp<br>
<div class=3D"Ih2E3d">&quot;./:target:$ASPECTWERKZ_HOME/lib/aspectwerkz-2.0=
.jar:$ASPECTWERKZ_HOME/lib/aspectwerkz-core-2.0.jar:$ASPECTWERKZ_HOME/lib/a=
spectwerkz-extensions-2.0.jar&quot;<br>
action.Detector 1`<br>
<br>
</div>This looks incorrect, but I completely have no idea where goes wrong.=
<br>
<br>
Would you please to give me advice?<br>
<br>
I really appreciate your help.<br>
<div><div></div><div class=3D"Wj3C7c"><br>
<br>
Alexandre Vasseur wrote:<br>
&gt;<br>
&gt; please consider using the javaagent option. That is the best option to=
<br>
&gt; consider in Java 5 / java 6.<br>
&gt;<br>
&gt; On Sun, Oct 26, 2008 at 2:24 PM, neo anderson<br>
&gt; &lt;<a href=3D"mailto:[email protected]">javadeveloper999@y=
ahoo.co.uk</a>&gt;wrote:<br>
&gt;<br>
&gt;&gt;<br>
&gt;&gt; After trying several times, I still can not get the online weaving=
<br>
&gt;&gt; worked.<br>
&gt;&gt; I<br>
&gt;&gt; think there are several things I still do not understand very well=
.<br>
&gt;&gt;<br>
&gt;&gt; Mainly it is &#39;What is the correct way (scenario) to execute th=
e online<br>
&gt;&gt; weaving?&#39;<br>
&gt;&gt;<br>
&gt;&gt; From the document at <a href=3D"http://aspectwerkz.codehaus.org/do=
wnloads/" target=3D"_blank">http://aspectwerkz.codehaus.org/downloads/</a> =
saying<br>
&gt;&gt; that,<br>
&gt;&gt; e.g. in transparent bootclasspath mode, running bin/aspectwerkz th=
e first<br>
&gt;&gt; JVM &nbsp;will launch the application JVM. However, if I switch to=
 run<br>
&gt;&gt; `$ASPECTWERKZ_HOME/bin/aspectwerkz -cp<br>
&gt;&gt;<br>
&gt;&gt; &quot;./:target:$ASPECTWERKZ_HOME/lib/aspectwerkz-2.0.jar:$ASPECTW=
ERKZ_HOME/lib/aspectwerkz-core-2.0.jar:$ASPECTWERKZ_HOME/lib/aspectwerkz-ex=
tensions-2.0.jar&quot;<br>
&gt;&gt; action.Detector 1`<br>
&gt;&gt;<br>
&gt;&gt; The output will shows some extra information<br>
&gt;&gt;<br>
&gt;&gt; java ... -Xrunjdwp:transport=3Ddt_socket,suspend=3Dy,address=3D930=
0,server=3Dy<br>
&gt;&gt; -Xdebug -Xbootclasspath/p ...<br>
&gt;&gt; ...<br>
&gt;&gt; Listening for transport dt_socket at address: 9300<br>
&gt;&gt; Listening for transport dt_socket at address: 9300<br>
&gt;&gt; AspectWerkz - INFO - Pre-processor<br>
&gt;&gt; org.codehaus.aspectwerkz.transform.AspectWerkzPreProcessor loaded =
and<br>
&gt;&gt; initialized<br>
&gt;&gt; Enable aspect! ...<br>
&gt;&gt; Deployer::INFO - deploying aspect [aspect.Observer] in class loade=
r<br>
&gt;&gt; sun.misc.Launcher$AppClassLoader@17182c1]<br>
&gt;&gt;<br>
&gt;&gt; but still there is no aop information weaved to the running server=
.<br>
&gt;&gt;<br>
&gt;&gt; Would you please to give me some advice or hints? (Sorry for this =
newbie<br>
&gt;&gt; question)<br>
&gt;&gt;<br>
&gt;&gt; Thanks again for the help. I appreciate it.<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; Alexandre Vasseur wrote:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; hot deployment MUST be in the same VM yes. Think deployment (=
of new<br>
&gt;&gt; aspect<br>
&gt;&gt; &gt; but whose compiled code is already available) as a &quot;runt=
ime weaving&quot;<br>
&gt;&gt; &gt; Amex<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; On Sun, Oct 19, 2008 at 10:50 PM, neo anderson<br>
&gt;&gt; &gt; &lt;<a href=3D"mailto:[email protected]">javadevel=
[email protected]</a><br>
&gt;&gt; &gt;&gt; wrote:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; I follow the example at<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; <a href=3D"http://blogs.codehaus.org/people/jboner/archives/000913=
_aspect_hot_deployment_in_practice_implementing_a_jmx_monitoring_aspect_.ht=
ml" target=3D"_blank">http://blogs.codehaus.org/people/jboner/archives/0009=
13_aspect_hot_deployment_in_practice_implementing_a_jmx_monitoring_aspect_.=
html</a><br>

&gt;&gt; &gt;&gt; to do hot deployment, but it fails. There is no error ret=
urned to the<br>
&gt;&gt; &gt;&gt; screen. It only prints message like:<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Deployer::INFO - deploying aspect [aspect.Observer] in cl=
ass loader<br>
&gt;&gt; &gt;&gt; sun.misc.Launcher$AppClassLoader@1a16869]<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; The target application does not print out anything.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; The code to do deployment is<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; package action;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; public class Detector{<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; ...<br>
&gt;&gt; &gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;void detect(){<br>
&gt;&gt; &gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Sy=
stem.out.println(&quot;Enable aspect! ...&quot;);<br>
&gt;&gt; &gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;De=
ployer.deploy(Observer.class, toXML());<br>
&gt;&gt; &gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;}<br>
&gt;&gt; &gt;&gt; ...<br>
&gt;&gt; &gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;private String toXML(){<br>
&gt;&gt; &gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;re=
turn &quot;&lt;aspect class=3D\&quot;Observer\&quot;&gt;&lt;pointcut<br>
&gt;&gt; &gt;&gt; name=3D\&quot;count\&quot;<br>
&gt;&gt; &gt;&gt; expression=3D\&quot;execution(* sys.Server.count(..))\&qu=
ot;/&gt;&lt;/aspect&gt;&quot;;<br>
&gt;&gt; &gt;&gt; /* //this xml throws not well formed xml definition excep=
tion<br>
&gt;&gt; &gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;re=
turn &quot;&lt;aspectwerkz&gt;\n&quot; +<br>
&gt;&gt; &gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &=
nbsp; &nbsp; &nbsp; &nbsp;&quot;&lt;system id=3D\&quot;Mock Server\&quot;&g=
t;\n&quot;+<br>
&gt;&gt; &gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &=
nbsp; &nbsp; &nbsp; &nbsp;&quot; &nbsp; &nbsp; &nbsp; &lt;package name=3D\&=
quot;aspect\&quot;&gt;\n&quot;+<br>
&gt;&gt; &gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &=
nbsp; &nbsp; &nbsp; &nbsp;&quot; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &lt;aspect class=3D\&quot;Observer\&quot;&gt;\n&quot;+<br>
&gt;&gt; &gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &=
nbsp; &nbsp; &nbsp; &nbsp;&quot; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;pointcut<br>
&gt;&gt; name=3D\&quot;count\&quot;<br>
&gt;&gt; &gt;&gt; expression=3D\&quot;execution(* sys.Server.count(..))\&qu=
ot;/&gt;\n&quot;+<br>
&gt;&gt; &gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &=
nbsp; &nbsp; &nbsp; &nbsp;&quot; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;advice<br>
&gt;&gt; &gt;&gt; name=3D\&quot;beforeCount\&quot;<br>
&gt;&gt; &gt;&gt; type=3D\&quot;before\&quot; bind-to=3D\&quot;count\&quot;=
/&gt;\n&quot;+<br>
&gt;&gt; &gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &=
nbsp; &nbsp; &nbsp; &nbsp;&quot; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;advice<br>
&gt;&gt; &gt;&gt; name=3D\&quot;afterCount\&quot;<br>
&gt;&gt; &gt;&gt; type=3D\&quot;after\&quot; bind-to=3D\&quot;count\&quot;/=
&gt;\n&quot;+<br>
&gt;&gt; &gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &=
nbsp; &nbsp; &nbsp; &nbsp;&quot; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &lt;/aspect&gt;\n&quot;+<br>
&gt;&gt; &gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &=
nbsp; &nbsp; &nbsp; &nbsp;&quot; &nbsp; &nbsp; &nbsp; &lt;/package&gt;\n&qu=
ot;+<br>
&gt;&gt; &gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &=
nbsp; &nbsp; &nbsp; &nbsp;&quot; &nbsp; &nbsp; &nbsp; &lt;/system&gt;\n&quo=
t;+<br>
&gt;&gt; &gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &=
nbsp; &nbsp; &nbsp; &nbsp;&quot;&lt;/aspectwerkz&gt;\n&quot;;<br>
&gt;&gt; &gt;&gt; */<br>
&gt;&gt; &gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;}<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Where the Observer.java aspect and the application (Serve=
r.java) to be<br>
&gt;&gt; &gt;&gt; weaved is the same as<br>
&gt;&gt; &gt;&gt; <a href=3D"http://www.nabble.com/Runtime-weaving-question=
-to20042123.html" target=3D"_blank">http://www.nabble.com/Runtime-weaving-q=
uestion-to20042123.html</a><br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; The way to test runtime weaving scenario is<br>
&gt;&gt; &gt;&gt; 1.) launch the server<br>
&gt;&gt; &gt;&gt; 2.) deploy the aspect by `java -cp<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &quot;target:$ASPECTWERKZ_HOME/lib/aspectwerkz-2.0.jar:$ASPECTWERK=
Z_HOME/lib/aspectwerkz-core-2.0.jar:$ASPECTWERKZ_HOME/lib/aspectwerkz-exten=
sions-2.0.jar&quot;<br>
&gt;&gt; &gt;&gt; action.Detector 1`<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; I also have a look at the example in jdk15/test folder, i=
n which it<br>
&gt;&gt; seems<br>
&gt;&gt; &gt;&gt; like the hot deployment is done on the same jvm, e.g.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; public class HotDeployedTest ...<br>
&gt;&gt; &gt;&gt; &nbsp; public void testDeployment() {<br>
&gt;&gt; &gt;&gt; ...<br>
&gt;&gt; &gt;&gt; &nbsp; &nbsp; Deployer.deploy(HotdeployableAspect.class);=
<br>
&gt;&gt; &gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;target();<br>
&gt;&gt; &gt;&gt; ...<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; I think I have done something wrong, but do not know wher=
e it is.<br>
&gt;&gt; Would<br>
&gt;&gt; &gt;&gt; anyone please give me some hint or advice?<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Thank you very much,<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Jonas Bon=E9r-3 wrote:<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; Yes it is possible, but you will have to define a so=
-called<br>
&gt;&gt; &gt;&gt; &gt; &#39;deployment scope&#39; and preweave the classes =
(will just add tiny<br>
&gt;&gt; hooks,<br>
&gt;&gt; &gt;&gt; &gt; but no aspects). Then you can do hot deploy and unde=
ploy in a<br>
&gt;&gt; running<br>
&gt;&gt; &gt;&gt; &gt; system.<br>
&gt;&gt; &gt;&gt; &gt; Details here:<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; <a href=3D"http://aspectwerkz.codehaus.org/new_features_in_2_0.htm=
l#Hot_deployment_and_undeployment_of_aspects" target=3D"_blank">http://aspe=
ctwerkz.codehaus.org/new_features_in_2_0.html#Hot_deployment_and_undeployme=
nt_of_aspects</a><br>

&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; /Jonas<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; On 10/3/07, Dongkwan Kim &lt;<a href=3D"mailto:vtdon=
[email protected]">[email protected]</a>&gt; wrote:<br>
&gt;&gt; &gt;&gt; &gt;&gt; Does AspectWerkz support the remote weaving? Let=
 me explain my<br>
&gt;&gt; &gt;&gt; scenario<br>
&gt;&gt; &gt;&gt; &gt;&gt; in<br>
&gt;&gt; &gt;&gt; &gt;&gt; detail.<br>
&gt;&gt; &gt;&gt; &gt;&gt; Suppose there is a running Java application. It =
don&#39;t know<br>
&gt;&gt; &gt;&gt; AspectWerkz.<br>
&gt;&gt; &gt;&gt; I<br>
&gt;&gt; &gt;&gt; &gt;&gt; want to insert an aspect into the running applic=
ation. This is<br>
&gt;&gt; called<br>
&gt;&gt; &gt;&gt; the<br>
&gt;&gt; &gt;&gt; &gt;&gt; remote weaving. Is there any way to weave alread=
y running Java<br>
&gt;&gt; &gt;&gt; classes?<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; DK<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; --<br>
&gt;&gt; &gt;&gt; &gt; Jonas Bon=E9r<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; <a href=3D"http://jonasboner.com" target=3D"_blank">=
http://jonasboner.com</a><br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; --<br>
&gt;&gt; &gt;&gt; View this message in context:<br>
&gt;&gt; &gt;&gt; <a href=3D"http://www.nabble.com/remote-weaving--tp130256=
50p20060099.html" target=3D"_blank">http://www.nabble.com/remote-weaving--t=
p13025650p20060099.html</a><br>
&gt;&gt; &gt;&gt; Sent from the AspectWerkz - User mailing list archive at =
Nabble.com.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; ---------------------------------------------------------=
------------<br>
&gt;&gt; &gt;&gt; To unsubscribe from this list, please visit:<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &nbsp; &nbsp;<a href=3D"http://xircles.codehaus.org/manag=
e_email" target=3D"_blank">http://xircles.codehaus.org/manage_email</a><br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; View this message in context:<br>
&gt;&gt; <a href=3D"http://www.nabble.com/remote-weaving--tp13025650p201734=
27.html" target=3D"_blank">http://www.nabble.com/remote-weaving--tp13025650=
p20173427.html</a><br>
&gt;&gt; Sent from the AspectWerkz - User mailing list archive at Nabble.co=
m.<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; ------------------------------------------------------------------=
---<br>
&gt;&gt; To unsubscribe from this list, please visit:<br>
&gt;&gt;<br>
&gt;&gt; &nbsp; &nbsp;<a href=3D"http://xircles.codehaus.org/manage_email" =
target=3D"_blank">http://xircles.codehaus.org/manage_email</a><br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
<br>
</div></div><font color=3D"#888888">--<br>
View this message in context: <a href=3D"http://www.nabble.com/remote-weavi=
ng--tp13025650p20197173.html" target=3D"_blank">http://www.nabble.com/remot=
e-weaving--tp13025650p20197173.html</a><br>
</font><div><div></div><div class=3D"Wj3C7c">Sent from the AspectWerkz - Us=
er mailing list archive at Nabble.com.<br>
<br>
<br>
---------------------------------------------------------------------<br>
To unsubscribe from this list, please visit:<br>
<br>
 &nbsp; &nbsp;<a href=3D"http://xircles.codehaus.org/manage_email" target=
=3D"_blank">http://xircles.codehaus.org/manage_email</a><br>
<br>
<br>
</div></div></blockquote></div><br>

------=_Part_52618_30170547.1225145423714--