cvs commit: spice/sandbox/sca/src/java/org/realityforge/sca/selector SelectorEventHandler.java SelectorManager.java
Peter Donald <[email protected]>
| Newsgroups | gmane.comp.java.spice.cvs |
|---|---|
| Message-ID | <[email protected]> |
donaldp 03/10/29 18:46:32
Added: sandbox/sca/src/java/org/realityforge/sca/selector
SelectorEventHandler.java SelectorManager.java
Log:
Initial cut of selector code based on that previously in netserve
Revision Changes Path
1.1 spice/sandbox/sca/src/java/org/realityforge/sca/selector/SelectorEventHandler.java
Index: SelectorEventHandler.java
===================================================================
/*
* Copyright (C) The Spice Group. All rights reserved.
*
* This software is published under the terms of the Spice
* Software License version 1.1, a copy of which has been included
* with this distribution in the LICENSE.txt file.
*/
package org.realityforge.sca.selector;
import java.nio.channels.SelectionKey;
/**
* Interface implemente to receive events from
* a Selector.
*/
public interface SelectorEventHandler
{
/**
* Method that receives events from selector.
* The user MUST NOT modify or access the
* keys attachment.
*
* @param key the SelectionKey
* @param userData the data user specified when registering listener
*/
void handleSelectorEvent( SelectionKey key, Object userData );
}
1.1 spice/sandbox/sca/src/java/org/realityforge/sca/selector/SelectorManager.java
Index: SelectorManager.java
===================================================================
/*
* Copyright (C) The Spice Group. All rights reserved.
*
* This software is published under the terms of the Spice
* Software License version 1.1, a copy of which has been included
* with this distribution in the LICENSE.txt file.
*/
package org.realityforge.sca.selector;
import java.io.IOException;
import java.nio.channels.SelectableChannel;
import java.nio.channels.SelectionKey;
/**
* Service enabling management of Non-blocking IO Channels.
* The service will call back the specified handler
* when one of the specified operations occurs on the
* channel.
*/
public interface SelectorManager
{
/**
* Register a channel with selector.
* Note the user MUST NOT modify the returned
* SelectionKeys attachment.
*
* @param channel the channel
* @param ops the operations to register
* @param handler the handler that will be notified on event
* @param userData the data passed back into the handler
* @return the SelectionKey
* @throws java.io.IOException if channel can not be registered
*/
SelectionKey registerChannel( SelectableChannel channel,
int ops,
SelectorEventHandler handler,
Object userData )
throws IOException;
}
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/