User: patriot1burke Date: 04/07/16 20:37:04 Added: docs/reference Asynchronous.html Asynchronous.wiki GOFObservable.html GOFObservable.wiki GOFObserverableTest.html GOFObserverableTest.wiki LogUtil.html LogUtil.wiki LogUtilObserver.html LogUtilObserver.wiki Observer.html Observer.wiki Subject.html Subject.wiki SubjectImpl.html SubjectImpl.wiki SubjectInterceptor.html SubjectInterceptor.wiki Temperature.html Temperature.wiki annotation14_security.html annotation14_security.wiki annotation15_security.html annotation15_security.wiki clustered_remoting.html clustered_remoting.wiki observable_xml.html observable_xml.wiki patterns.html patterns.wiki remoting.html remoting.wiki security.html security.wiki security_context.html security_context.wiki threadbased.html threadbased.wiki threadbased.wiki~ transaction_demarcation.html transaction_demarcation.wiki transaction_injection.html transaction_injection.wiki transaction_locking.html transaction_locking.wiki xml_security.html xml_security.wiki Log: added documentation added javadocs/documentaiton to dist script Revision Changes Path 1.1 jboss-aspects/docs/reference/Asynchronous.html Index: Asynchronous.html =================================================================== <html> <body> <p> <h2>AOP Asynchronous Method Invocation</h2> <i>This aspect can run outside of JBoss application server</i> </p><p> </p><p> <h3>Goal</h3> </p><p> The aim of this AOP service is to achieve asynchronous method invocation to plain old JAVA object (POJO). </p><p> </p><p> <h3>Features</h3> </p><p> <ul> <li> Implemented as a standalone service (can run outside of JBOSS).</li> <li> Ability to define Asynchronous method declaration in XML or using JDK1.5 annotations.</li> <li> Support ONEWAY and REQUEST/REPLY asynchronous method invocation.</li> <li> Support of instance and static asynchronous method invocation.</li> <li> Support of public, protected, private and package method.</li> <li> Support of concurrent invocation on same instance/static method.</li> <li> Ability to define Timeout value for duration of asynchronous method execution.</li> <li> Thread pooling Management (Min/Max threads, keep-alive, abort/wait policy) </li> </ul> </p><p> </p><p> <h3>Example</h3> </p><p> <h4><i>POJO implementation using JDK1.4 or JDK1.5 annotations for Asynchronous method declaration. For JDK 1.4 you need the AnnotationCompiler</i></h4> </p><p> <b>JDK 1.4</b> <pre> public class POJO { /** @@org.jboss.aspects.asynchronous.aspects.jboss.Asynchronous */ public void processBusinessModel(){...} /** @@org.jboss.aspects.asynchronous.aspects.jboss.Asynchronous (timeout=5000)*/ public long processBusinessModel(...){} } </pre> </p><p> <b>JDK 5.0</b> <pre> import org.jboss.aspects.asynchronous.aspects.jboss.Asynchronous; public class POJO { public void processBusinessModel(){...} @Asynchronous public long processBusinessModel(...){} } </pre> </p><p> </p><p> <h4><i>Asynchronous Method Invocation and result process within same thread of execution</i></h4> </p><p> <pre> POJO pojo = new POJO(...); </pre> <b>/* Asynchronous Method Invocation */</b> <pre> long result=pojo.processBusinessModel(...); ... ... </pre> <b>/* non-blocking call */</b> <pre> if (((AsynchronousFacade)pojo).isDone()) { AsynchronousFacade aF=(AsynchronousFacade)pojo; </pre> <b>/* Test response code returned */</b> <pre> if (aF.getResponseCode()==OK) </pre> <b>/* get method response processed asynchronously */</b> <pre> result = ((Long)aF.getReturnValue()).longValue(); </pre> <b>/* Test if method timed out */</b> <pre> else if (aF.getResponseCode()==TIMEOUT) {...} else ... } else { </pre> <b>/* blocking call */</b> <pre> AsynchronousResponse aR = ((AsynchronousFacade)pojo).waitForResponse(); If (aR.getResponseCode()==OK) </pre> <b>/* get method response processed asynchronously */</b> <pre> result=((Long)aR.getReturnValue()).longValue(); </pre> <b>/* Test if method timed out */</b> <pre> else if (aR.getReponseCode()==TIMEOUT) {...} else {...} } </pre> </p><p> </p><p> </p><p> <h3>Implementation</h3> Few pointers regarding the implementation . The implementation is broken down in 4 components : </p><p> <ul> <li>Asynchronous Engine Definition\\</li> </ul> /org/jboss/aspects/asynchronous\\ /org/jboss/aspects/asynchronous/common\\ </p><p> <ul> <li>Asynchronous Engine Implementation with the concurrent package\\</li> </ul> /org/jboss/aspects/asynchronous/concurrent\\ </p><p> <ul> <li>Asynchronous Facade Definition and Implementation (Mixin Class)\\</li> </ul> /org/jboss/aspects/asynchronous/aspects\\ </p><p> <ul> <li>Asynchronous Aspect Implementation with JBOSS-AOP\\</li> </ul> /org/jboss/aspects/asynchronus/aspects/jboss\\ The Asynchronous Aspect is composed of one Mixin class (AsynchronousFacade.java) and one method interceptor.(AsynchronousAspect.java) </p><p> </p><p> <h3>Configuration</h3> <ul> <li><a href="asynch_xml.html">JBOSS-AOP.xml</a></li> </ul> If not running within JBoss you'll need this binding: <pre> <?xml version="1.0" encoding="UTF-8"?> <aop> <aspect class="org.jboss.aspects.asynchronous.aspects.jboss.AsynchronousAspect" scope="PER_VM"/> <bind pointcut="execution(* *->@org.jboss.aspects.asynchronous.aspects.jboss.Asynchronous(..))"> <advice name="execute" aspect="org.jboss.aspects.asynchronous.aspects.jboss.AsynchronousAspect"/> </bind> <introduction expr="has(* *->@org.jboss.aspects.asynchronous.aspects.jboss.Asynchronous(..)) OR class(@org.jboss.aspects.asynchronous.aspects.jboss.Asynchronous)"> <mixin> <interfaces> org.jboss.aspects.asynchronous.aspects.AsynchronousFacade </interfaces> <class>org.jboss.aspects.asynchronous.aspects.AsynchronousFacadeImpl</class> <construction>new org.jboss.aspects.asynchronous.aspects.AsynchronousFacadeImpl()</construction> </mixin> </introduction> </aop> </pre> </p><p> <ul> <li><a href="threadManager.html">threadManager.properties</a></li> </ul> </p><p> <h3>Author</h3> <ul> <li>Claude Hussenet (mailto:chu...@ya...)</li> </ul> </p> </body> </html> 1.1 jboss-aspects/docs/reference/Asynchronous.wiki Index: Asynchronous.wiki =================================================================== !!!AOP Asynchronous Method Invocation ''This aspect can run outside of JBoss application server'' !!Goal The aim of this AOP service is to achieve asynchronous method invocation to plain old JAVA object (POJO). !!Features * Implemented as a standalone service (can run outside of JBOSS). * Ability to define Asynchronous method declaration in XML or using JDK1.5 annotations. * Support ONEWAY and REQUEST/REPLY asynchronous method invocation. * Support of instance and static asynchronous method invocation. * Support of public, protected, private and package method. * Support of concurrent invocation on same instance/static method. * Ability to define Timeout value for duration of asynchronous method execution. * Thread pooling Management (Min/Max threads, keep-alive, abort/wait policy) !!Example !''POJO implementation using JDK1.4 or JDK1.5 annotations for Asynchronous method declaration. For JDK 1.4 you need the AnnotationCompiler'' __JDK 1.4__ {{{ public class POJO { /** @@org.jboss.aspects.asynchronous.aspects.jboss.Asynchronous */ public void processBusinessModel(){...} /** @@org.jboss.aspects.asynchronous.aspects.jboss.Asynchronous (timeout=5000)*/ public long processBusinessModel(...){} } }}} __JDK 5.0__ {{{ import org.jboss.aspects.asynchronous.aspects.jboss.Asynchronous; public class POJO { public void processBusinessModel(){...} @Asynchronous public long processBusinessModel(...){} } }}} !''Asynchronous Method Invocation and result process within same thread of execution'' {{{ POJO pojo = new POJO(...); }}} __/* Asynchronous Method Invocation */__ {{{ long result=pojo.processBusinessModel(...); ... ... }}} __/* non-blocking call */__ {{{ if (((AsynchronousFacade)pojo).isDone()) { AsynchronousFacade aF=(AsynchronousFacade)pojo; }}} __/* Test response code returned */__ {{{ if (aF.getResponseCode()==OK) }}} __/* get method response processed asynchronously */__ {{{ result = ((Long)aF.getReturnValue()).longValue(); }}} __/* Test if method timed out */__ {{{ else if (aF.getResponseCode()==TIMEOUT) {...} else ... } else { }}} __/* blocking call */__ {{{ AsynchronousResponse aR = ((AsynchronousFacade)pojo).waitForResponse(); If (aR.getResponseCode()==OK) }}} __/* get method response processed asynchronously */__ {{{ result=((Long)aR.getReturnValue()).longValue(); }}} __/* Test if method timed out */__ {{{ else if (aR.getReponseCode()==TIMEOUT) {...} else {...} } }}} !!Implementation Few pointers regarding the implementation . The implementation is broken down in 4 components : *Asynchronous Engine Definition\\ /org/jboss/aspects/asynchronous\\ /org/jboss/aspects/asynchronous/common\\ *Asynchronous Engine Implementation with the concurrent package\\ /org/jboss/aspects/asynchronous/concurrent\\ *Asynchronous Facade Definition and Implementation (Mixin Class)\\ /org/jboss/aspects/asynchronous/aspects\\ *Asynchronous Aspect Implementation with JBOSS-AOP\\ /org/jboss/aspects/asynchronus/aspects/jboss\\ The Asynchronous Aspect is composed of one Mixin class (AsynchronousFacade.java) and one method interceptor.(AsynchronousAspect.java) !!Configuration *[JBOSS-AOP.xml|asynch_xml.html] If not running within JBoss you'll need this binding: {{{ <?xml version="1.0" encoding="UTF-8"?> <aop> <aspect class="org.jboss.aspects.asynchronous.aspects.jboss.AsynchronousAspect" scope="PER_VM"/> <bind pointcut="execution(* *->@org.jboss.aspects.asynchronous.aspects.jboss.Asynchronous(..))"> <advice name="execute" aspect="org.jboss.aspects.asynchronous.aspects.jboss.AsynchronousAspect"/> </bind> <introduction expr="has(* *->@org.jboss.aspects.asynchronous.aspects.jboss.Asynchronous(..)) OR class(@org.jboss.aspects.asynchronous.aspects.jboss.Asynchronous)"> <mixin> <interfaces> org.jboss.aspects.asynchronous.aspects.AsynchronousFacade </interfaces> <class>org.jboss.aspects.asynchronous.aspects.AsynchronousFacadeImpl</class> <construction>new org.jboss.aspects.asynchronous.aspects.AsynchronousFacadeImpl()</construction> </mixin> </introduction> </aop> }}} *[threadManager.properties|threadManager.html] !!Author *Claude Hussenet (mailto:chu...@ya...) 1.1 jboss-aspects/docs/reference/GOFObservable.html Index: GOFObservable.html =================================================================== <html> <body> <p> <h2> Observable</h2> </p><p> Defines a one to many relationship between the Subject (the object being observed) and the Observers where the Observers are notified of changed state in the Subject. </p><p> <h3> The problem</h3> </p><p> We have a Temperature object and we want to log the changes to the temperature.\\ Using OOPS we would have to modify the Temperature class.\\ Using AOP we can Introduce new behaviour without touching the original class. </p><p> We already have a logging utility class and we don't need to change that either.\\ There is no need for it to know about the Temperature class.\\ Again we can Introduce new behaviour. </p><p> <h3> Implementation</h3> </p><p> The jboss implementation of the pattern </p><p> <ul> <li> <a href="Observer.html">Observer</a> - the interface "implemented" by the Observer</li> <li> <a href="Subject.html">Subject</a> - the interface "implemented" by the Subject</li> <li> <a href="SubjectImpl.html">SubjectImpl</a> - we use an Introduction to make Objects into Subjects</li> <li> <a href="SubjectInterceptor.html">SubjectInterceptor</a> - this advice tracks the state of the Subject and fires the changes to the Observers</li> </ul> </p><p> <h3> Existing Code</h3> </p><p> The exisiting application that knows nothing about the Observable pattern </p><p> <ul> <li> <a href="Temperature.html">Temperature</a> - simple POJO holding a temperature value in its state</li> <li> <a href="LogUtil.html">LogUtil</a> - simple POJO that logs to System.out</li> </ul> </p><p> <h3> Integration Code</h3> </p><p> To integrate the two classes we write an Introduction for <tt>LogUtil</tt> that tells it log the changes in Subjects. <ul> <li> <a href="LogUtilObserver.html">LogUtilObserver</a> - makes <tt>LogUtil</tt> into a generic Observer without changing the original code</li> </ul> </p><p> <h3> Configuration</h3> </p><p> Now we use AOP to tie it all together <ul> <li> <a href="observable_xml.html">jboss-aop.xml</a> - the JBossAOP deployment description</li> </ul> </p><p> <h3> The test class</h3> <ul> <li> <a href="GOFObserverableTest.html">ObserverableTest</a> - A simple test</li> </ul> </p><p> <h3> The output</h3> It doesn't look very exciting but ... <pre> Received Notification: Temperature=10 </pre> </p><p> <h3> Conclusion</h3> <ul> <li> We have taken two existing <a href="/Wiki.jsp?page=POJO">POJO</a>s that know nothing about the Observable pattern and integrated them using AOP.</li> <li> The only code we had to write was how to handle the change notification: <a href="LogUtilObserver.html">LogUtilObserver</a> which is exactly what you want to write when you are the integerator</li> <li> JBoss has already implemented the Observable pattern, we don't have to write this boiler plate code.</li> </ul> </p><p> <ul> <li> <b>AOP is a very powerful tool for integrating reusable components without touching the original code</b>.</li> </ul> </p><p> <ul> <li> <b>You no longer have to repeat boiler plate code</b> in all classes just in case somebody might want a particular feature - <b>a boring task that is prone to error</b> and difficult to change when it is spread across many classes</li> </ul> </p><p> <h3> Things to try</h3> <ul> <li> Use <a href="remoting.html">AOPRemoting</a> to make this pattern distributed</li> </ul> </p> </body> </html> 1.1 jboss-aspects/docs/reference/GOFObservable.wiki Index: GOFObservable.wiki =================================================================== !!! Observable Defines a one to many relationship between the Subject (the object being observed) and the Observers where the Observers are notified of changed state in the Subject. !! The problem We have a Temperature object and we want to log the changes to the temperature.\\ Using OOPS we would have to modify the Temperature class.\\ Using AOP we can Introduce new behaviour without touching the original class. We already have a logging utility class and we don't need to change that either.\\ There is no need for it to know about the Temperature class.\\ Again we can Introduce new behaviour. !! Implementation The jboss implementation of the pattern * [Observer|Observer.html] - the interface "implemented" by the Observer * [Subject|Subject.html] - the interface "implemented" by the Subject * [SubjectImpl|SubjectImpl.html] - we use an Introduction to make Objects into Subjects * [SubjectInterceptor|SubjectInterceptor.html] - this advice tracks the state of the Subject and fires the changes to the Observers !! Existing Code The exisiting application that knows nothing about the Observable pattern * [Temperature|Temperature.html] - simple POJO holding a temperature value in its state * [LogUtil|LogUtil.html] - simple POJO that logs to System.out !! Integration Code To integrate the two classes we write an Introduction for {{LogUtil}} that tells it log the changes in Subjects. * [LogUtilObserver|LogUtilObserver.html] - makes {{LogUtil}} into a generic Observer without changing the original code !! Configuration Now we use AOP to tie it all together * [jboss-aop.xml|observable_xml.html] - the JBossAOP deployment description !! The test class * [ObserverableTest|GOFObserverableTest.html] - A simple test !! The output It doesn't look very exciting but ... {{{ Received Notification: Temperature=10 }}} !! Conclusion * We have taken two existing [POJO]s that know nothing about the Observable pattern and integrated them using AOP. * The only code we had to write was how to handle the change notification: [LogUtilObserver|LogUtilObserver.html] which is exactly what you want to write when you are the integerator * JBoss has already implemented the Observable pattern, we don't have to write this boiler plate code. * __AOP is a very powerful tool for integrating reusable components without touching the original code__. * __You no longer have to repeat boiler plate code__ in all classes just in case somebody might want a particular feature - __a boring task that is prone to error__ and difficult to change when it is spread across many classes !! Things to try * Use [AOPRemoting|remoting.html] to make this pattern distributed 1.1 jboss-aspects/docs/reference/GOFObserverableTest.html Index: GOFObserverableTest.html =================================================================== <html> <body> <p> <pre> /* * JBoss, the OpenSource J2EE webOS * * Distributable under LGPL license. * See terms of license at gnu.org. */ package org.jboss.test.aop.bean; import org.jboss.aop.patterns.observable.Observer; import org.jboss.aop.patterns.observable.Subject; /** * A simple test of the Observerable aspect * * @author <a href="mailto:ad...@jb...">Adrian Brock</a> * @version $Revision: 1.1 $ */ public class ObservableTester { public static void main(String args) throws Exception { // Create our pojos - nothing new here Temperature temperature = new Temperature(); LogUtil logUtil = new LogUtil(); // But look, we can cast them to our introductions Subject subject = (Subject) temperature; Observer observer = (Observer) logUtil; // And link them subject.addObserver(observer); // Now this logs the change temperature.setTemperature(10); } } </pre> </p> </body> </html> 1.1 jboss-aspects/docs/reference/GOFObserverableTest.wiki Index: GOFObserverableTest.wiki =================================================================== {{{ /* * JBoss, the OpenSource J2EE webOS * * Distributable under LGPL license. * See terms of license at gnu.org. */ package org.jboss.test.aop.bean; import org.jboss.aop.patterns.observable.Observer; import org.jboss.aop.patterns.observable.Subject; /** * A simple test of the Observerable aspect * * @author <a href="mailto:ad...@jb...">Adrian Brock</a> * @version $Revision: 1.1 $ */ public class ObservableTester { public static void main(String args) throws Exception { // Create our pojos - nothing new here Temperature temperature = new Temperature(); LogUtil logUtil = new LogUtil(); // But look, we can cast them to our introductions Subject subject = (Subject) temperature; Observer observer = (Observer) logUtil; // And link them subject.addObserver(observer); // Now this logs the change temperature.setTemperature(10); } } }}} 1.1 jboss-aspects/docs/reference/LogUtil.html Index: LogUtil.html =================================================================== <html> <body> <p> <pre> /* * JBoss, the OpenSource J2EE webOS * * Distributable under LGPL license. * See terms of license at gnu.org. */ package org.jboss.test.aop.bean; /** * A simple logger * * @author <a href="mailto:ad...@jb...">Adrian Brock</a> * @version $Revision: 1.1 $ */ public class LogUtil { public void log(String message) { System.out.println(message); } } </pre> </p> </body> </html> 1.1 jboss-aspects/docs/reference/LogUtil.wiki Index: LogUtil.wiki =================================================================== {{{ /* * JBoss, the OpenSource J2EE webOS * * Distributable under LGPL license. * See terms of license at gnu.org. */ package org.jboss.test.aop.bean; /** * A simple logger * * @author <a href="mailto:ad...@jb...">Adrian Brock</a> * @version $Revision: 1.1 $ */ public class LogUtil { public void log(String message) { System.out.println(message); } } }}} 1.1 jboss-aspects/docs/reference/LogUtilObserver.html Index: LogUtilObserver.html =================================================================== <html> <body> <p> <pre> /* * JBoss, the OpenSource J2EE webOS * * Distributable under LGPL license. * See terms of license at gnu.org. */ package org.jboss.test.aop.bean; import org.jboss.aop.patterns.observable.Observer; import org.jboss.aop.patterns.observable.Subject; /** * Log all notifications of Subject changes * * @author <a href="mailto:ad...@jb...">Adrian Brock</a> * @version $Revision: 1.1 $ */ public class LogUtilObserver implements Observer { private LogUtil logUtil; public LogUtilObserver(LogUtil logUtil) { this.logUtil = logUtil; } public void fireChange(Subject subject) { logUtil.log("Received Notification: " + subject.toString()); } } </pre> </p> </body> </html> 1.1 jboss-aspects/docs/reference/LogUtilObserver.wiki Index: LogUtilObserver.wiki =================================================================== {{{ /* * JBoss, the OpenSource J2EE webOS * * Distributable under LGPL license. * See terms of license at gnu.org. */ package org.jboss.test.aop.bean; import org.jboss.aop.patterns.observable.Observer; import org.jboss.aop.patterns.observable.Subject; /** * Log all notifications of Subject changes * * @author <a href="mailto:ad...@jb...">Adrian Brock</a> * @version $Revision: 1.1 $ */ public class LogUtilObserver implements Observer { private LogUtil logUtil; public LogUtilObserver(LogUtil logUtil) { this.logUtil = logUtil; } public void fireChange(Subject subject) { logUtil.log("Received Notification: " + subject.toString()); } } }}} 1.1 jboss-aspects/docs/reference/Observer.html Index: Observer.html =================================================================== <html> <body> <p> <pre> /* * JBoss, the OpenSource J2EE webOS * * Distributable under LGPL license. * See terms of license at gnu.org. */ package org.jboss.aop.patterns.observable; /** * An Observer. Implement this interface to register * for subject changes. * * @author <a href="ad...@jb...">Adrian Brock</a> * @version $Revision: 1.1 $ */ public interface Observer { /** * Notification that a subject has changed * * @param subject the subject */ void fireChange(Subject subject); } </pre> </p> </body> </html> 1.1 jboss-aspects/docs/reference/Observer.wiki Index: Observer.wiki =================================================================== {{{ /* * JBoss, the OpenSource J2EE webOS * * Distributable under LGPL license. * See terms of license at gnu.org. */ package org.jboss.aop.patterns.observable; /** * An Observer. Implement this interface to register * for subject changes. * * @author <a href="ad...@jb...">Adrian Brock</a> * @version $Revision: 1.1 $ */ public interface Observer { /** * Notification that a subject has changed * * @param subject the subject */ void fireChange(Subject subject); } }}} 1.1 jboss-aspects/docs/reference/Subject.html Index: Subject.html =================================================================== <html> <body> <p> <pre> /* * JBoss, the OpenSource J2EE webOS * * Distributable under LGPL license. * See terms of license at gnu.org. */ package org.jboss.aop.patterns.observable; /** * A Subject. This interface is exposed on the advised object. * * @author <a href="ad...@jb...">Adrian Brock</a> * @version $Revision: 1.1 $ */ public interface Subject { /** * Add an observer * * @param observer the observer */ void addObserver(Observer observer); /** * Remove an observer * * @param observer the observer */ void removeObserver(Observer observer); /** * Notify all observers */ void notifyObservers(); } </pre> </p> </body> </html> 1.1 jboss-aspects/docs/reference/Subject.wiki Index: Subject.wiki =================================================================== {{{ /* * JBoss, the OpenSource J2EE webOS * * Distributable under LGPL license. * See terms of license at gnu.org. */ package org.jboss.aop.patterns.observable; /** * A Subject. This interface is exposed on the advised object. * * @author <a href="ad...@jb...">Adrian Brock</a> * @version $Revision: 1.1 $ */ public interface Subject { /** * Add an observer * * @param observer the observer */ void addObserver(Observer observer); /** * Remove an observer * * @param observer the observer */ void removeObserver(Observer observer); /** * Notify all observers */ void notifyObservers(); } }}} 1.1 jboss-aspects/docs/reference/SubjectImpl.html Index: SubjectImpl.html =================================================================== <html> <body> <p> <pre> /* * JBoss, the OpenSource J2EE webOS * * Distributable under LGPL license. * See terms of license at gnu.org. */ package org.jboss.aop.patterns.observable; import java.util.Collections; import java.util.HashSet; import java.util.Iterator; import java.util.Set; /** * The subject implementation. * * @author <a href="ad...@jb...">Adrian Brock</a> * @version $Revision: 1.1 $ */ public class SubjectImpl implements Subject { /** The observers */ private Set observers = Collections.synchronizedSet(new HashSet()); /** The subject */ private Object subject; public SubjectImpl(Object subject) { this.subject = subject; } public void addObserver(Observer observer) { observers.add(observer); } public void removeObserver(Observer observer) { observers.remove(observer); } public void notifyObservers() { Subject obj = (Subject) subject; synchronized (observers) { for (Iterator i = observers.iterator(); i.hasNext();) { Observer observer = (Observer) i.next(); observer.fireChange(obj); } } } } </pre> </p> </body> </html> 1.1 jboss-aspects/docs/reference/SubjectImpl.wiki Index: SubjectImpl.wiki =================================================================== {{{ /* * JBoss, the OpenSource J2EE webOS * * Distributable under LGPL license. * See terms of license at gnu.org. */ package org.jboss.aop.patterns.observable; import java.util.Collections; import java.util.HashSet; import java.util.Iterator; import java.util.Set; /** * The subject implementation. * * @author <a href="ad...@jb...">Adrian Brock</a> * @version $Revision: 1.1 $ */ public class SubjectImpl implements Subject { /** The observers */ private Set observers = Collections.synchronizedSet(new HashSet()); /** The subject */ private Object subject; public SubjectImpl(Object subject) { this.subject = subject; } public void addObserver(Observer observer) { observers.add(observer); } public void removeObserver(Observer observer) { observers.remove(observer); } public void notifyObservers() { Subject obj = (Subject) subject; synchronized (observers) { for (Iterator i = observers.iterator(); i.hasNext();) { Observer observer = (Observer) i.next(); observer.fireChange(obj); } } } } }}} 1.1 jboss-aspects/docs/reference/SubjectInterceptor.html Index: SubjectInterceptor.html =================================================================== <html> <body> <p> <pre> /* * JBoss, the OpenSource J2EE webOS * * Distributable under LGPL license. * See terms of license at gnu.org. */ package org.jboss.aop.patterns.observable; import org.jboss.aop.advice.Interceptor; import org.jboss.aop.joinpoint.FieldInvocation; import org.jboss.aop.joinpoint.Invocation; /** * A Subject Interceptor. Traps changes to the object * and fires change notifications. * * @author <a href="ad...@jb...">Adrian Brock</a> * @version $Revision: 1.1 $ */ public class SubjectInterceptor implements Interceptor { public String getName() { return "Observerable"; } public Object invoke(Invocation invocation) throws Throwable { FieldInvocation fi = (FieldInvocation) invocation; Object before = fi.field.get(fi.targetObject); Object result = invocation.invokeNext(); Object after = fi.field.get(fi.targetObject); // If it changed fire notifications if (before == null && after != null || before.equals(after) == false) { Subject observable = (Subject) fi.targetObject; observable.notifyObservers(); } return result; } } </pre> </p> </body> </html> 1.1 jboss-aspects/docs/reference/SubjectInterceptor.wiki Index: SubjectInterceptor.wiki =================================================================== {{{ /* * JBoss, the OpenSource J2EE webOS * * Distributable under LGPL license. * See terms of license at gnu.org. */ package org.jboss.aop.patterns.observable; import org.jboss.aop.advice.Interceptor; import org.jboss.aop.joinpoint.FieldInvocation; import org.jboss.aop.joinpoint.Invocation; /** * A Subject Interceptor. Traps changes to the object * and fires change notifications. * * @author <a href="ad...@jb...">Adrian Brock</a> * @version $Revision: 1.1 $ */ public class SubjectInterceptor implements Interceptor { public String getName() { return "Observerable"; } public Object invoke(Invocation invocation) throws Throwable { FieldInvocation fi = (FieldInvocation) invocation; Object before = fi.field.get(fi.targetObject); Object result = invocation.invokeNext(); Object after = fi.field.get(fi.targetObject); // If it changed fire notifications if (before == null && after != null || before.equals(after) == false) { Subject observable = (Subject) fi.targetObject; observable.notifyObservers(); } return result; } } }}} 1.1 jboss-aspects/docs/reference/Temperature.html Index: Temperature.html =================================================================== <html> <body> <p> <pre> /* * JBoss, the OpenSource J2EE webOS * * Distributable under LGPL license. * See terms of license at gnu.org. */ package org.jboss.test.aop.bean; /** * A simple holder for a temperature value * * @author <a href="mailto:ad...@jb...">Adrian Brock</a> * @version $Revision: 1.1 $ */ public class Temperature { private int temperature = 0; public int getTemperature() { return temperature; } public void setTemperature(int temperature) { this.temperature = temperature; } public String toString() { return "Temperature=" + temperature; } } </pre> </p> </body> </html> 1.1 jboss-aspects/docs/reference/Temperature.wiki Index: Temperature.wiki =================================================================== {{{ /* * JBoss, the OpenSource J2EE webOS * * Distributable under LGPL license. * See terms of license at gnu.org. */ package org.jboss.test.aop.bean; /** * A simple holder for a temperature value * * @author <a href="mailto:ad...@jb...">Adrian Brock</a> * @version $Revision: 1.1 $ */ public class Temperature { private int temperature = 0; public int getTemperature() { return temperature; } public void setTemperature(int temperature) { this.temperature = temperature; } public String toString() { return "Temperature=" + temperature; } } }}} 1.1 jboss-aspects/docs/reference/annotation14_security.html Index: annotation14_security.html =================================================================== <html> <body> <p> <h2>JDK 1.4 Annotated Security</h2> AOP Security brings J2EE/EJB like security to plain Java classes. Read up on EJB security to get a feel of what we are talking about here. You can apply security either through XML or via annotations. </p><p> Annotated Security with JDK 1.4 requires our AnnotationCompiler. There are 5 annotations that make up annotated security. These annotations almost identically match EJB3 based annotations. </p><p> <ul> <li> <tt>org.jboss.aspects.security.SecurityDomain</tt></li> <li> <tt>org.jboss.aspects.security.Permissions</tt></li> <li> <tt>org.jboss.aspects.security.Unchecked</tt></li> <li> <tt>org.jboss.aspects.security.Excluded</tt></li> <li> <tt>org.jboss.aspects.security.RunAs</tt></li> </ul> </p><p> <pre> /** * @@org.jboss.aspects.security.SecurityDomain ("other") * @@org.jboss.aspects.security.RunAs ({"allowed"}) */ public class AnnotatedSecuredPOJO { /** * @@org.jboss.aspects.security.Permissions ({"allowed"}) */ public int someField; /** * @@org.jboss.aspects.security.Exclude */ public String excludedField; /** * @@org.jboss.aspects.security.Unchecked */ public long uncheckedField; /** * @@org.jboss.aspects.security.Unchecked */ public AnnotatedSecuredPOJO() { } /** * @@org.jboss.aspects.security.Permissions ({"allowed"}) */ public AnnotatedSecuredPOJO(int field) { someField = field; } /** * @@org.jboss.aspects.security.Unchecked */ public void unchecked() {} /** * @@org.jboss.aspects.security.Permissions ({"allowed"}) */ public void someMethod() { } } </pre> </p><p> <b><tt>org.jboss.aspects.security.SecurityDomain</tt></b> </p><p> The <tt>@SecurityDomain</tt> annotation defines the JBoss security domain to use. See JBoss J2EE documentation on what this means. Basically it specifies the repository where usernames, passwords, and user/role associtations are stored. This annotation is only applicable at the Class level. </p><p> </p><p> <b><tt>org.jboss.aspects.security.SecurityDomain</tt></b> </p><p> The <tt>@RunAs</tt> annotation works in the same way as the EJB run-as tag. This annotation is only applicable at the Class level. </p><p> <b><tt>org.jboss.aspects.security.Permissions</tt></b> </p><p> The <tt>@Permissions</tt> annotation works in the much in the same way as the EJB method-permissions tag works in XML the difference being it can be applied to any method (static or member), any field (static or member), or any constructor. </p><p> <b><tt>org.jboss.aspects.security.Exclude</tt></b> </p><p> The <tt>@Exlude</tt> annotation works in the much in the same way as the EJB exclude-list tag works in XML the difference being it can be applied to any method (static or member), any field (static or member), or any constructor. </p><p> <b><tt>org.jboss.aspects.security.Unchecked</tt></b> </p><p> The <tt>@Unchecked</tt> annotation works in the much in the same way as the EJB unchecked tag works in XML the difference being it can be applied to any method (static or member), any field (static or member), or any constructor. </p> </body> </html> 1.1 jboss-aspects/docs/reference/annotation14_security.wiki Index: annotation14_security.wiki =================================================================== !!!!JDK 1.4 Annotated Security AOP Security brings J2EE/EJB like security to plain Java classes. Read up on EJB security to get a feel of what we are talking about here. You can apply security either through XML or via annotations. Annotated Security with JDK 1.4 requires our AnnotationCompiler. There are 5 annotations that make up annotated security. These annotations almost identically match EJB3 based annotations. * {{org.jboss.aspects.security.SecurityDomain}} * {{org.jboss.aspects.security.Permissions}} * {{org.jboss.aspects.security.Unchecked}} * {{org.jboss.aspects.security.Excluded}} * {{org.jboss.aspects.security.RunAs}} {{{ /** * @@org.jboss.aspects.security.SecurityDomain ("other") * @@org.jboss.aspects.security.RunAs ({"allowed"}) */ public class AnnotatedSecuredPOJO { /** * @@org.jboss.aspects.security.Permissions ({"allowed"}) */ public int someField; /** * @@org.jboss.aspects.security.Exclude */ public String excludedField; /** * @@org.jboss.aspects.security.Unchecked */ public long uncheckedField; /** * @@org.jboss.aspects.security.Unchecked */ public AnnotatedSecuredPOJO() { } /** * @@org.jboss.aspects.security.Permissions ({"allowed"}) */ public AnnotatedSecuredPOJO(int field) { someField = field; } /** * @@org.jboss.aspects.security.Unchecked */ public void unchecked() {} /** * @@org.jboss.aspects.security.Permissions ({"allowed"}) */ public void someMethod() { } } }}} __{{org.jboss.aspects.security.SecurityDomain}}__ The {{@SecurityDomain}} annotation defines the JBoss security domain to use. See JBoss J2EE documentation on what this means. Basically it specifies the repository where usernames, passwords, and user/role associtations are stored. This annotation is only applicable at the Class level. __{{org.jboss.aspects.security.SecurityDomain}}__ The {{@RunAs}} annotation works in the same way as the EJB run-as tag. This annotation is only applicable at the Class level. __{{org.jboss.aspects.security.Permissions}}__ The {{@Permissions}} annotation works in the much in the same way as the EJB method-permissions tag works in XML the difference being it can be applied to any method (static or member), any field (static or member), or any constructor. __{{org.jboss.aspects.security.Exclude}}__ The {{@Exlude}} annotation works in the much in the same way as the EJB exclude-list tag works in XML the difference being it can be applied to any method (static or member), any field (static or member), or any constructor. __{{org.jboss.aspects.security.Unchecked}}__ The {{@Unchecked}} annotation works in the much in the same way as the EJB unchecked tag works in XML the difference being it can be applied to any method (static or member), any field (static or member), or any constructor. 1.1 jboss-aspects/docs/reference/annotation15_security.html Index: annotation15_security.html =================================================================== <html> <body> <p> <h2>JDK 5.0 Annotated Security</h2> AOP Security brings J2EE/EJB like security to plain Java classes. Read up on EJB security to get a feel of what we are talking about here. You can apply security either through XML or via annotations. </p><p> There are 5 annotations that make up annotated security. These annotations almost identically match EJB3 based annotations. </p><p> <ul> <li> <tt>org.jboss.aspects.security.SecurityDomain</tt></li> <li> <tt>org.jboss.aspects.security.Permissions</tt></li> <li> <tt>org.jboss.aspects.security.Unchecked</tt></li> <li> <tt>org.jboss.aspects.security.Excluded</tt></li> <li> <tt>org.jboss.aspects.security.RunAs</tt></li> </ul> </p><p> <pre> import org.jboss.aspects.security.*; @SecurityDomain("other") @RunAs("allowed") public class AnnotatedSecuredPOJO { @Permissions({"allowed"}) public int someField; @Exclude public String excludedField; @Unchecked public long uncheckedField; @Permissions({"allowed"}) public AnnotatedSecuredPOJO(int field) { someField = field; } @Unchecked public void unchecked() {} @Permissions({"allowed"}) public void someMethod() { } } </pre> </p><p> <b><tt>org.jboss.aspects.security.SecurityDomain</tt></b> </p><p> The <tt>@SecurityDomain</tt> annotation defines the JBoss security domain to use. See JBoss J2EE documentation on what this means. Basically it specifies the repository where usernames, passwords, and user/role associtations are stored. This annotation is only applicable at the Class level. </p><p> </p><p> <b><tt>org.jboss.aspects.security.SecurityDomain</tt></b> </p><p> The <tt>@RunAs</tt> annotation works in the same way as the EJB run-as tag. This annotation is only applicable at the Class level. </p><p> <b><tt>org.jboss.aspects.security.Permissions</tt></b> </p><p> The <tt>@Permissions</tt> annotation works in the much in the same way as the EJB method-permissions tag works in XML the difference being it can be applied to any method (static or member), any field (static or member), or any constructor. </p><p> <b><tt>org.jboss.aspects.security.Exclude</tt></b> </p><p> The <tt>@Exlude</tt> annotation works in the much in the same way as the EJB exclude-list tag works in XML the difference being it can be applied to any method (static or member), any field (static or member), or any constructor. </p><p> <b><tt>org.jboss.aspects.security.Unchecked</tt></b> </p><p> The <tt>@Unchecked</tt> annotation works in the much in the same way as the EJB unchecked tag works in XML the difference being it can be applied to any method (static or member), any field (static or member), or any constructor. </p> </body> </html> 1.1 jboss-aspects/docs/reference/annotation15_security.wiki Index: annotation15_security.wiki =================================================================== !!!!JDK 5.0 Annotated Security AOP Security brings J2EE/EJB like security to plain Java classes. Read up on EJB security to get a feel of what we are talking about here. You can apply security either through XML or via annotations. There are 5 annotations that make up annotated security. These annotations almost identically match EJB3 based annotations. * {{org.jboss.aspects.security.SecurityDomain}} * {{org.jboss.aspects.security.Permissions}} * {{org.jboss.aspects.security.Unchecked}} * {{org.jboss.aspects.security.Excluded}} * {{org.jboss.aspects.security.RunAs}} {{{ import org.jboss.aspects.security.*; @SecurityDomain("other") @RunAs("allowed") public class AnnotatedSecuredPOJO { @Permissions({"allowed"}) public int someField; @Exclude public String excludedField; @Unchecked public long uncheckedField; @Permissions({"allowed"}) public AnnotatedSecuredPOJO(int field) { someField = field; } @Unchecked public void unchecked() {} @Permissions({"allowed"}) public void someMethod() { } } }}} __{{org.jboss.aspects.security.SecurityDomain}}__ The {{@SecurityDomain}} annotation defines the JBoss security domain to use. See JBoss J2EE documentation on what this means. Basically it specifies the repository where usernames, passwords, and user/role associtations are stored. This annotation is only applicable at the Class level. __{{org.jboss.aspects.security.SecurityDomain}}__ The {{@RunAs}} annotation works in the same way as the EJB run-as tag. This annotation is only applicable at the Class level. __{{org.jboss.aspects.security.Permissions}}__ The {{@Permissions}} annotation works in the much in the same way as the EJB method-permissions tag works in XML the difference being it can be applied to any method (static or member), any field (static or member), or any constructor. __{{org.jboss.aspects.security.Exclude}}__ The {{@Exlude}} annotation works in the much in the same way as the EJB exclude-list tag works in XML the difference being it can be applied to any method (static or member), any field (static or member), or any constructor. __{{org.jboss.aspects.security.Unchecked}}__ The {{@Unchecked}} annotation works in the much in the same way as the EJB unchecked tag works in XML the difference being it can be applied to any method (static or member), any field (static or member), or any constructor. 1.1 jboss-aspects/docs/reference/clustered_remoting.html Index: clustered_remoting.html =================================================================== <html> <body> <p> <h2>Clustered Remoting</h2> <i>Clustered AOP Remoting didn't receive much TLC for the 1.0 beta release although we did fix a few critical bugs. We'll put more TLC in the next release</i> </p><p> Clustered remoting works a little differently than regular AOP remoting. It leverages the clustering framework implemented for EJBs. <pre> import org.jboss.ha.framework.interfaces.RoundRobin; ... POJO remote = new POJO("hello"); return (POJO)ClusteredRemoting.registerClusteredObject("clusteredobj", remote, "DefaultPartition", new RoundRobin(), "socket://servername:8084"); </pre> Unlike regular AOP remoting, clients cannot independently connect to a clustered object. Here's a look at the API. <pre> package org.jboss.aop.remoting; import javax.naming.InitialContext; import org.jboss.aop.Advised; import org.jboss.aop.InstanceAdvised; import org.jboss.aop.InstanceAdvisor; import org.jboss.aop.PayloadKey; import org.jboss.aop.proxy.ClassProxy; import org.jboss.aop.proxy.ClassProxyFactory; import org.jboss.ha.framework.server.HATarget; import org.jboss.ha.framework.interfaces.HAPartition; import org.jboss.ha.framework.interfaces.LoadBalancePolicy; import org.jboss.ha.framework.interfaces.GenericClusteringException; import org.jboss.ha.framework.interfaces.ClusteringTargetsRepository; import org.jboss.ha.framework.interfaces.FamilyClusterInfo; import org.jboss.logging.Logger; import org.jboss.remoting.InvokerLocator; import org.jboss.aop.Dispatcher; public class ClusteredRemoting implements ClusterConstants { public static ClassProxy registerClusteredObject(Object objectId, Object obj, String partitionName, LoadBalancePolicy lb, String uri) throws Exception public static ClassProxy registerClusteredObject(Object objectId, Object obj, String partitionName, LoadBalancePolicy lb, InvokerLocator locator) throws Exception } </pre> </p><p> The ClusteredRemoting static methods register with the Dispatcher for you. The partitionName corresponds to the Cluster Partition you want the object to be used with. Pre-implemented load balance policies are RoundRobin and FirstAvailable. See the EJB clustering docs for more information. </p> </body> </html> 1.1 jboss-aspects/docs/reference/clustered_remoting.wiki Index: clustered_remoting.wiki =================================================================== !!!Clustered Remoting ''Clustered AOP Remoting didn't receive much TLC for the 1.0 beta release although we did fix a few critical bugs. We'll put more TLC in the next release'' Clustered remoting works a little differently than regular AOP remoting. It leverages the clustering framework implemented for EJBs. {{{ import org.jboss.ha.framework.interfaces.RoundRobin; ... POJO remote = new POJO("hello"); return (POJO)ClusteredRemoting.registerClusteredObject("clusteredobj", remote, "DefaultPartition", new RoundRobin(), "socket://servername:8084"); }}} Unlike regular AOP remoting, clients cannot independently connect to a clustered object. Here's a look at the API. {{{ package org.jboss.aop.remoting; import javax.naming.InitialContext; import org.jboss.aop.Advised; import org.jboss.aop.InstanceAdvised; import org.jboss.aop.InstanceAdvisor; import org.jboss.aop.PayloadKey; import org.jboss.aop.proxy.ClassProxy; import org.jboss.aop.proxy.ClassProxyFactory; import org.jboss.ha.framework.server.HATarget; import org.jboss.ha.framework.interfaces.HAPartition; import org.jboss.ha.framework.interfaces.LoadBalancePolicy; import org.jboss.ha.framework.interfaces.GenericClusteringException; import org.jboss.ha.framework.interfaces.ClusteringTargetsRepository; import org.jboss.ha.framework.interfaces.FamilyClusterInfo; import org.jboss.logging.Logger; import org.jboss.remoting.InvokerLocator; import org.jboss.aop.Dispatcher; public class ClusteredRemoting implements ClusterConstants { public static ClassProxy registerClusteredObject(Object objectId, Object obj, String partitionName, LoadBalancePolicy lb, String uri) throws Exception public static ClassProxy registerClusteredObject(Object objectId, Object obj, String partitionName, LoadBalancePolicy lb, InvokerLocator locator) throws Exception } }}} The ClusteredRemoting static methods register with the Dispatcher for you. The partitionName corresponds to the Cluster Partition you want the object to be used with. Pre-implemented load balance policies are RoundRobin and FirstAvailable. See the EJB clustering docs for more information. 1.1 jboss-aspects/docs/reference/observable_xml.html Index: observable_xml.html =================================================================== <html> <body> <p> <pre> <?xml version="1.0" encoding="UTF-8"?> <aop> <!-- Instrument the classes for AOP --> <prepare expr="all(org.jboss.test.aop.bean.Temperature)"/> <prepare expr="all(org.jboss.test.aop.bean.LogUtil)"/> <prepare expr="all(org.jboss.test.aop.bean.ObservableTester)"/> <!-- Make the Temperature POJO a Subject/Observerable --> <bind pointcut="set(* org.jboss.test.aop.bean.Temperature->*)"> <interceptor class="org.jboss.aop.patterns.observable.SubjectInterceptor"/> </bind> <introduction class="org.jboss.test.aop.bean.Temperature"> <mixin> <interfaces>org.jboss.aop.patterns.observable.Subject</interfaces> <class>org.jboss.aop.patterns.observable.SubjectImpl</class> <construction>new org.jboss.aop.patterns.observable.SubjectImpl(this)</construction> </mixin> </introduction> <!-- Make the LogUtil an Observer --> <introduction class="org.jboss.test.aop.bean.LogUtil"> <mixin> <interfaces>org.jboss.aop.patterns.observable.Observer</interfaces> <class>org.jboss.test.aop.bean.LogUtilObserver</class> <construction>new org.jboss.test.aop.bean.LogUtilObserver(this)</construction> </mixin> </introduction> </aop> </pre> </p> </body> </html> 1.1 jboss-aspects/docs/reference/observable_xml.wiki Index: observable_xml.wiki =================================================================== {{{ <?xml version="1.0" encoding="UTF-8"?> <aop> <!-- Instrument the classes for AOP --> <prepare expr="all(org.jboss.test.aop.bean.Temperature)"/> <prepare expr="all(org.jboss.test.aop.bean.LogUtil)"/> <prepare expr="all(org.jboss.test.aop.bean.ObservableTester)"/> <!-- Make the Temperature POJO a Subject/Observerable --> <bind pointcut="set(* org.jboss.test.aop.bean.Temperature->*)"> <interceptor class="org.jboss.aop.patterns.observable.SubjectInterceptor"/> </bind> <introduction class="org.jboss.test.aop.bean.Temperature"> <mixin> <interfaces>org.jboss.aop.patterns.observable.Subject</interfaces> <class>org.jboss.aop.patterns.observable.SubjectImpl</class> <construction>new org.jboss.aop.patterns.observable.SubjectImpl(this)</construction> </mixin> </introduction> <!-- Make the LogUtil an Observer --> <introduction class="org.jboss.test.aop.bean.LogUtil"> <mixin> <interfaces>org.jboss.aop.patterns.observable.Observer</interfaces> <class>org.jboss.test.aop.bean.LogUtilObserver</class> <construction>new org.jboss.test.aop.bean.LogUtilObserver(this)</construction> </mixin> </introduction> </aop> }}} 1.1 jboss-aspects/docs/reference/patterns.html Index: patterns.html =================================================================== <html> <body> <p> <h3> Gang Of Four Patterns</h3> </p><p> The GOF patterns can be implementated using AOP to avoid having to repeat the same boiler plate code in all your classes. </p><p> <ul> <li> <a href="GOFObservable.html">Observable</a> - Notification of changed state in an object </li> </ul> </p><p> <ul> <li> Another obvious candidate is <a href=" http://www.castle-cadenza.demon.co.uk/visitor.htm">Visitor </a> which should fit the same introduction pattern.</li> </ul> </p> </body> </html> 1.1 jboss-aspects/docs/reference/patterns.wiki Index: patterns.wiki =================================================================== !! Gang Of Four Patterns The GOF patterns can be implementated using AOP to avoid having to repeat the same boiler plate code in all your classes. * [Observable|GOFObservable.html] - Notification of changed state in an object * Another obvious candidate is [Visitor | http://www.castle-cadenza.demon.co.uk/visitor.htm] which should fit the same introduction pattern. 1.1 jboss-aspects/docs/reference/remoting.html Index: remoting.html =================================================================== <html> <body> <p> <h2>Remoting</h2> <i>AOP Remoting didn't receive much TLC for the 1.0 beta release although we did fix a few critical bugs. We'll put more TLC in the next release</i> </p><p> The AOP framework has API's to hook up plain Java classes to JBoss Remoting. These hooks allow you to arbitrarily decide whether or not to make an object remoting. It also gives you the ability to create a reference to a remote object simply by providing a URI. </p><p> Out-of-the-box, AOP remoting is easy enough to use. You can make any object remotely accessible whether it is instrumented by the AOP framework or not (see Bytocode manipulation controls). There are a couple of requirements though: </p><p> <ul> <li> The object's class must have a default constructor.</li> <li> Remotely invoked method parameters and return values must be Serializable. </li> </ul> </p><p> The first thing you must do in code is register your object with an AOP specific registry, the Dispatcher. <pre> import org.jboss.aop.Dispatcher; ... POJO pojo = new POJO(); Dispatcher.singleton.registerTarget("YourOwnObjectId", pojo); </pre> Next, you must create a proxy that can connect to this object. This is where you can decide what protocol is used to connect to this object. You can also decide how to make your remote object available over the network by binding it to JNDI for instance. <pre> import org.jboss.aop.remoting.Remoting; ... POJO proxy = (POJO)Remoting.createRemoteProxy("YourOwnObjectId", pojo.getClass(), "socket://servername:8084"); new InitialContext().bind("/remote/YourOwnObjectId", proxy); </pre> The last parameter of createRemoteProxy is a URI. Out of the box, here's the URI's that JBoss supports. You can configure JBoss Remoting with different ports and protocols if you like though. </p><p> Valid URIs: </p><p> <ul> <li> socket://servername:8084 Is is a custom socket based protocol.</li> <li> soap://servername SOAP packets over HTTP. </li> </ul> </p><... [truncated message content] |