bloritsch 02/02/01 12:06:24
Added: src/java/org/apache/avalon/cornerstone/services/silk
NoSuchSourceException.java SourceMap.java
Stage.java StageManager.java
Log:
initial interfaces for Silk implementation
Revision Changes Path
1.1
jakarta-avalon-cornerstone/src/java/org/apache/avalon/cornerstone/services/silk/NoSuchSourceException.java
Index: NoSuchSourceException.java
===================================================================
/*
* Copyright (C) The Apache Software Foundation, All rights reserved.
*
* This software is published under the terms of the Apache Software License
* version 1.1, a copy of which has been included with this distribution in
* the LICENSE.txt file.
*/
package org.apache.avalon.cornerstone.services.silk;
import org.apache.avalon.framework.CascadingException;
/**
* The NoSuchSourceException is used by the SourceMap when a Source that is
* supposed to be associated with a name is not found.
*
* @author <a href="[EMAIL PROTECTED]">Berin Loritsch</a>
* @version CVS $Revision: 1.1 $ $Date: 2002/02/01 20:06:24 $
*/
public class NoSuchSourceException extends CascadingException {
public NoSuchSourceException( String message )
{
super( message );
}
public NoSuchSourceException( String message, Throwable source )
{
super( message, source );
}
}
1.1
jakarta-avalon-cornerstone/src/java/org/apache/avalon/cornerstone/services/silk/SourceMap.java
Index: SourceMap.java
===================================================================
/*
* Copyright (C) The Apache Software Foundation, All rights reserved.
*
* This software is published under the terms of the Apache Software License
* version 1.1, a copy of which has been included with this distribution in
* the LICENSE.txt file.
*/
package org.apache.avalon.cornerstone.services.silk;
import org.apache.avalon.excalibur.event.Source;
/**
* The SourceMap is an abstraction to allow the container to centrally manage
all
* connections within its scope. This allows the system to remain using
Inversion
* of Control, while allowing a system to be reassigned at any time.
*
* @author <a href="[EMAIL PROTECTED]">Berin Loritsch</a>
* @version CVS $Revision: 1.1 $ $Date: 2002/02/01 20:06:24 $
*/
public interface SourceMap {
/**
* This gets the main Source for the SourceMap. A SourceMap must have at
* least one Source.
*
* @return the main <code>Source</code> for the SourceMap.
*/
Source getMainSource();
/**
* Get the named Source. If the SourceMap does not contain a match for
the
* name, the method throws an exception.
*
* @param name The name of the desired source
*
* @return Source the source associated with the name
* @throws NoSuchSourceException if no source is associated with the name
*/
Source getSource( String name )
throws NoSuchSourceException;
/**
* The SourceArray allows the Stage to get an array of all Sources
attached
* to the stage.
*
* @return an array of <code>Source</code> objects. There is at least one
* Source in the array.
*/
Source[] getSourceArray();
}
1.1
jakarta-avalon-cornerstone/src/java/org/apache/avalon/cornerstone/services/silk/Stage.java
Index: Stage.java
===================================================================
/*
* Copyright (C) The Apache Software Foundation, All rights reserved.
*
* This software is published under the terms of the Apache Software License
* version 1.1, a copy of which has been included with this distribution in
* the LICENSE.txt file.
*/
package org.apache.avalon.cornerstone.services.silk;
import org.apache.avalon.framework.component.Component;
/**
* The Stage is a specialized type of Component. It allows the system to be
set
* up in a pipeline, with asynchronously managed pipelines. Stages are
usually
* managed by name in its container. In the SILK architecture, the Containers
* are connected through the SilkServer interface.
*
* <p>
* The Stage is a central concept in Matt Welsh's SEDA system. Our Stage is
* identical to his in concept, but our interface does not allow for
subversion
* of control. A stage is assigned one or more outputs (Sources for the
next
* stage, or specialized Source types that do not connect to anything. A
* stage also has an EventHandler associated with it.
* </p>
* <p>
* The EventHandler is identified in the Stage's configuration. The Stage
* Container invokes the necessary EventHandler for the Stage.
* </p>
* <p class="note">
* TBD: How do we want the EventHandler associated with the stage? Should
the
* stage implement EventHandler, should the configuration file manage the
class
* to be invoked, or should there be a <code>getHandler</code> method?
* </p>
*
* @author <a href="[EMAIL PROTECTED]">Berin Loritsch</a>
* @version CVS $Revision: 1.1 $ $Date: 2002/02/01 20:06:24 $
*/
public interface Stage extends Component {
/**
* Sets the SourceMap for the Stage. This allows the stage to specify
* exactly what Source we are feeding with events. The SourceMap is set
* once, and only once during the life of the stage. Stages are meant to
* be simple components, and the SourceMap is the last method to be called
* during initialization.
*/
void setSourceMap( SourceMap map );
}
1.1
jakarta-avalon-cornerstone/src/java/org/apache/avalon/cornerstone/services/silk/StageManager.java
Index: StageManager.java
===================================================================
/*
* Copyright (C) The Apache Software Foundation, All rights reserved.
*
* This software is published under the terms of the Apache Software License
* version 1.1, a copy of which has been included with this distribution in
* the LICENSE.txt file.
*/
package org.apache.avalon.cornerstone.services.silk;
import org.apache.avalon.excalibur.event.Source;
/**
* The SilkServer provides the mechanism to join seemingly separated blocks
* into one large Staged Event Driven Architecture server. The word "Seda"
* means silk in Spanish. I added a play on that definition for the work
Silk.
* It is Staged Interblock Linking Kernel.
*
* <p>
* The concepts listed in this specification are heavily influenced by Matt
* Welsh's SEDA architecture. It has been tested to be insanely scalable,
* to the point where a Java based server can service more clients than its
* C based counterpart.
* </p>
*
* @author <a href="[EMAIL PROTECTED]">Berin Loritsch</a>
* @version CVS $Revision: 1.1 $ $Date: 2002/02/01 20:06:24 $
*/
public interface SilkServer {
String ROLE = "org.apache.avalon.cornerstone.services.silk.SilkServer";
/**
* Gets the source for a specified stage name.
*/
SourceMap getSourceMap( String stageName );
}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>