Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 351147 - Emit TimeoutChangedEvent from SignalProtocol
Summary: Emit TimeoutChangedEvent from SignalProtocol
Status: CLOSED FIXED
Alias: None
Product: EMF
Classification: Modeling
Component: cdo.net4j (show other bugs)
Version: 4.1   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Eike Stepper CLA
QA Contact: Eike Stepper CLA
URL:
Whiteboard: Power to the People
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-05 04:28 EDT by Eike Stepper CLA
Modified: 2012-09-21 07:16 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eike Stepper CLA 2011-07-05 04:28:14 EDT
public final class TimeoutChangedEvent extends Event
  {
    private static final long serialVersionUID = 1L;

    private long oldTimeout;

    private long newTimeout;

    public TimeoutChangedEvent(long oldTimeout, long newTimeout)
    {
      super(SignalProtocol.this);
      this.oldTimeout = oldTimeout;
      this.newTimeout = newTimeout;
    }

    @Override
    public SignalProtocol<?> getSource()
    {
      return (SignalProtocol<?>)super.getSource();
    }

    public long getOldTimeout()
    {
      return oldTimeout;
    }

    public long getNewTimeout()
    {
      return newTimeout;
    }
  }
Comment 1 Eike Stepper CLA 2011-07-05 04:38:30 EDT
Usage: 

    org.eclipse.emf.cdo.net4j.CDOSession session = (org.eclipse.emf.cdo.net4j.CDOSession)openSession();
    session.options().getProtocol().addListener(new IListener()
    {
      public void notifyEvent(IEvent event)
      {
        if (event instanceof TimeoutChangedEvent)
        {
          TimeoutChangedEvent e = (TimeoutChangedEvent)event;
          System.out.println(e);
        }
      }
    });

    session.options().getProtocol().setTimeout(20L * 1000L);
Comment 2 Eike Stepper CLA 2011-07-05 04:38:54 EDT
Committed revision 8595:
- trunk/plugins/org.eclipse.emf.cdo.tests
- trunk/plugins/org.eclipse.net4j
Comment 3 Eike Stepper CLA 2011-07-05 04:39:56 EDT
Committed revision 8595
Comment 4 Eike Stepper CLA 2012-09-21 07:16:28 EDT
Closing.