1. /*
  2. * @(#)EventHandler.java 1.4 03/12/19
  3. *
  4. * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package com.sun.corba.se.pept.transport;
  8. import java.nio.channels.SelectableChannel;
  9. import java.nio.channels.SelectionKey;
  10. import com.sun.corba.se.spi.orbutil.threadpool.Work;
  11. /**
  12. * @author Harold Carr
  13. *
  14. * This should only be registered with ONE selector.
  15. */
  16. public interface EventHandler
  17. {
  18. public void setUseSelectThreadToWait(boolean x);
  19. public boolean shouldUseSelectThreadToWait();
  20. public SelectableChannel getChannel();
  21. public int getInterestOps();
  22. public void setSelectionKey(SelectionKey selectionKey);
  23. public SelectionKey getSelectionKey();
  24. public void handleEvent();
  25. // NOTE: if there is more than one interest op this does not
  26. // allow discrimination between different ops and how threading
  27. // is handled.
  28. public void setUseWorkerThreadForEvent(boolean x);
  29. public boolean shouldUseWorkerThreadForEvent();
  30. public void setWork(Work work);
  31. public Work getWork();
  32. // REVISIT: need base class with two derived.
  33. public Acceptor getAcceptor();
  34. public Connection getConnection();
  35. }
  36. // End of file.