Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Network application (WhiteDog)

I used AspectJ for network system (named WhiteDog) that enables
object-sharing via network.

http://untrod.keihanna.ne.jp/whitedog/index_en.html
(demo applets and Aspect codes available)

here is the sample Aspect Code enabling object-sharing.

-- ShinkeiSuijakuAspect.aj --
import java.applet.Applet;

public aspect ShinkeiSuijakuAspect extends AbstractAppletAspect{
  before(): execution(void ShinkeiSuijaku.init()){
    applet_ = (Applet)thisJoinPoint.getTarget();
    registerObject("object.ShinkeiSuijaku", applet_);
  }

  public void ShinkeiSuijaku.start(){}
  after(): execution(void ShinkeiSuijaku.start()){
    connect(applet_.getCodeBase().getHost(), 12539);
  }

  public void ShinkeiSuijaku.stop(){}
  after(): execution(void ShinkeiSuijaku.stop()){
    close();
  }

  pointcut concernedMethodsExecution():
    execution(void ShinkeiSuijaku.mouseReleased(..))
    || execution(void ShinkeiSuijaku.mousePressed(..));

  private Applet applet_;
}
----

Applying this Aspect Code to ShinkeiSuijaku(memory game) applet,
the applet can be shared via network.


takao.


Back to the top