> From: Jonathan Hawkes [mailto:[EMAIL PROTECTED]
>
> public interface Aspect {
> void setContainer(Container c);
> }
>
> public interface Container {
> void addContainerServicesListener(ContainerServicesListener l); }
>
>
> Something like the java.beans.context package? Registered
> aspects can peruse or register to be notified of particular
> containment services?
That would put a burden on the container to maintain a list
of services exposed and so on, and a burden on the aspect to
"pull" services from the container.
I was more thinking like this: Any aspect that can be monitored
exposes a Monitorable interface.
When you add a LoggerAspect, it will iterate over all existing
aspects and connect to them via the Monitorable interface.
public interface Monitorable {
// Get the interface the monitor must implement
public Class getMonitorClass ();
// sets the monitor. It is guaranteed to implement the
// interface given by the getMonitorClass method
public void setMonitor (Object monitor);
}
The aspect would then do:
forall Aspect a in allCurrentAspects:
if a instanceof Monitorable
Class monitorClass = a.getMonitorClass();
Object loggerMonitor = createLoggerMonitor (monitorClass);
// loggerMonitor implements monitorClass
a.setMonitor (loggerMonitor);
Thus, the logger/monitor aspect pushes services to those that want
it.
/LS
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]