|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.cocoon.components.source.impl.AvalonToCocoonSourceInvocationHandler
public class AvalonToCocoonSourceInvocationHandler
An InvocationHandler
which acts as a proxy for excalibur
Source
objects to make them compatible with the cocoon
Source
interface.
Much of the code was taken from AvalonToCocoonSource
.
Field Summary | |
---|---|
protected Environment |
environment
The environment |
protected ComponentManager |
manager
The manager |
protected SourceResolver |
resolver
The source resolver |
protected Source |
source
The real source |
Constructor Summary | |
---|---|
AvalonToCocoonSourceInvocationHandler(Source source,
SourceResolver resolver,
Environment environment,
ComponentManager manager)
Constructor |
Method Summary | |
---|---|
static Source |
createProxy(Source source,
SourceResolver resolver,
Environment environment,
ComponentManager manager)
Creates a dynamic proxy for an excalibur Source object to
make it behave like a cocoon Source . |
InputSource |
getInputSource()
Return an InputSource object to read the XML
content. |
InputStream |
getInputStream()
Return an InputStream object to read from the source. |
String |
getSystemId()
Return the unique identifer for this source |
Object |
invoke(Object proxy,
Method method,
Object[] args)
Processes a method invocation on a proxy instance and returns the result. |
void |
recycle()
|
void |
refresh()
|
void |
toSAX(ContentHandler handler)
Stream content to a content handler or to an XMLConsumer. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Source source
protected SourceResolver resolver
protected Environment environment
protected ComponentManager manager
Constructor Detail |
---|
public AvalonToCocoonSourceInvocationHandler(Source source, SourceResolver resolver, Environment environment, ComponentManager manager)
Method Detail |
---|
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
invoke
in interface InvocationHandler
proxy
- the Cocoon source proxy instance that the method was invoked onmethod
- the Method instance corresponding to the interface method
invoked on the proxy instance.args
- the arguments for the interface method
Throwable
public InputStream getInputStream() throws ProcessingException, IOException
InputStream
object to read from the source.
ProcessingException
IOException
public InputSource getInputSource() throws ProcessingException, IOException
InputSource
object to read the XML
content.
InputSource
value
ProcessingException
- if an error occurs
IOException
- if an error occurspublic String getSystemId()
public void recycle()
public void refresh()
public void toSAX(ContentHandler handler) throws SAXException
SAXException
- if failed to parse source document.public static Source createProxy(Source source, SourceResolver resolver, Environment environment, ComponentManager manager) throws SourceException
Source
object to
make it behave like a cocoon Source
.
source
- the source object to be wrapped
Source
interface and all of the interfaces that the wrapped object
implements
SourceException
- in case of an error
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |