Yes, when it doesn't work.
 
<?xml version="1.0"?>
<module id="mainmodule" version="0.1.0">
 
  <service-point id="Dispatcher" interface="EventDispatcher">
    <create-instance class="EventDispatcherImpl"/>
  </service-point>
 
  <service-point id="Broker" interface="EventBroker">
    <invoke-factory>
      <construct class="EventBrokerImpl">
        <set-service property="dispatcher" service-id="Dispatcher"/>
    <invoke-factory>
  </service-point>
 
  <service-point id="VTMain" interface="VTMain">
    <invoke-factory>
      <construct class="VTMain"/>
    </invoke-factory>
  </service-point>
 

</module>
The above is something like the hivemod. The broker has a set dispatcher method, and the main class has a set broker method, both implement the interface as type.
 
I'm not sure why I had to use the set-service contrib, because I though HM would inject the dispatcher itself, it knows the interface. However, I am still quite new to this and am frustrated by lack of clear documentation by examples of the concepts.
 
John
----- Original Message -----
Sent: Thursday, January 26, 2006 1:17 PM
Subject: RE: wait - notify

Where is this logic?  Is it inside a HiveMind service implementation object?

 


From: John Coleman [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 25, 2006 7:39 PM
To: [email protected]
Subject: wait - notify

 

Hi,

 

Any ideas if it could be HiveMind stopping this wait/notify code running?

 

  public void dispatchEvent(EventObject event) {
    events.add(event);
    System.out.println("dispatch event..." + event);
    synchronized (this) {
      notify(); // break wait state
    }
    System.out.println("notified");
  }

 

  // a loop to dispatch events to the correct type of listeners
  public void run() {
    // loop handling all events until stop is true
    do {
      try {
        // wait for some event notifications
        synchronized (this) {
          wait();
        }....

 

 

If I do wait(10) then code works fine, but the sync blocks don't seem effective. If I directly instantiate the classes w/o HM, then code works!

 

John

 

Reply via email to