org.jvoicexml.jndi.client
Class MappedDocumentRepositoryStub

java.lang.Object
  extended by org.jvoicexml.jndi.client.MappedDocumentRepositoryStub
All Implemented Interfaces:
Referenceable, MappedDocumentRepository, Stub

public final class MappedDocumentRepositoryStub
extends Object
implements MappedDocumentRepository, Stub

Stub for the MappedDocumentRepository.

Since:
0.4
Version:
$Revision: 202 $

Copyright © 2006-2007 JVoiceXML group - http://jvoicexml.sourceforge.net/

Author:
Dirk Schnelle
See Also:
DocumentMap

Constructor Summary
MappedDocumentRepositoryStub()
          Constructs a new object.
MappedDocumentRepositoryStub(Context context)
          Constructs a new object.
 
Method Summary
 void addDocument(URI uri, String document)
          Adds the given document to this repository.
 void addDocument(URI uri, VoiceXmlDocument document)
          Adds the given document to this repository.
protected  void clearSkeleton()
          Clears a known remote reference to the skeleton.
 Context getContext()
          Retrieves the context to use.
protected  ErrorEvent getErrorEvent(Throwable throwable)
          Digs into the throwable and tries to find an ErrorEvent in the root cause hierarchy.
protected  Class getLocalClass()
          Retrieves the type of the local interface.
 Reference getReference()
          
protected  Class<RemoteMappedDocumentRepository> getRemoteClass()
          Retrieves the type of the remote interface.
protected  T getSkeleton(String... suffix)
          Lazy instantiation of the skeleton.
 String getStubName()
          Retrieves the name to which the stub is bound.
 URI getUri(String ssp)
          Gets an URI that can be evaluated by this scheme strategy for the given ssp.
 void setContext(Context ctx)
          Sets the JNDI context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.naming.Referenceable
getReference
 

Constructor Detail

MappedDocumentRepositoryStub

public MappedDocumentRepositoryStub()
Constructs a new object.


MappedDocumentRepositoryStub

public MappedDocumentRepositoryStub(Context context)
Constructs a new object.

Parameters:
context - The context to use.
Since:
0.6
Method Detail

getStubName

public String getStubName()
Retrieves the name to which the stub is bound.

Specified by:
getStubName in interface Stub
Returns:
Name of the stub.

getRemoteClass

protected Class<RemoteMappedDocumentRepository> getRemoteClass()
Retrieves the type of the remote interface.

Returns:
Type of the remote interface.

getLocalClass

protected Class getLocalClass()
Retrieves the type of the local interface.

Returns:
Type of the local interface.

getUri

public URI getUri(String ssp)
Gets an URI that can be evaluated by this scheme strategy for the given ssp.

Specified by:
getUri in interface MappedDocumentRepository
Parameters:
ssp - Scheme specific part
Returns:
Valid URI for this strategy, null in case of an error.

addDocument

public void addDocument(URI uri,
                        String document)
Adds the given document to this repository.

Specified by:
addDocument in interface MappedDocumentRepository
Parameters:
uri - URI as a key for later retrieval.
document - Document to be added.

addDocument

public void addDocument(URI uri,
                        VoiceXmlDocument document)
Adds the given document to this repository.

Specified by:
addDocument in interface MappedDocumentRepository
Parameters:
uri - URI as a key for later retrieval.
document - Document to be added.

setContext

public final void setContext(Context ctx)
Sets the JNDI context.

Parameters:
ctx - The context to use.
Since:
0.6

getContext

public Context getContext()
Retrieves the context to use.

Returns:
The context to use.

getReference

public final Reference getReference()
                             throws NamingException

Specified by:
getReference in interface Referenceable
Throws:
NamingException

getSkeleton

protected final T getSkeleton(String... suffix)
Lazy instantiation of the skeleton.

This method tries to lookup the skeleton with the following name
getRemoteClass().getSimpleName().suffix[0].suffix[1]...
If no suffixes are given the simple class name is used instead.

Parameters:
suffix - List of suffixes to be appended.
Returns:
The skeleton to use for remote method calls, null in case of an error.

clearSkeleton

protected final void clearSkeleton()
Clears a known remote reference to the skeleton.

This method must be called in case of a remote exception. As a consequence a following method call will try to retreive a new fresh reference to the skeleton.


getErrorEvent

protected final ErrorEvent getErrorEvent(Throwable throwable)
Digs into the throwable and tries to find an ErrorEvent in the root cause hierarchy.

Parameters:
throwable - The throwable to examine.
Returns:
Detected ErrorEvent or null if there is none.


Copyright © 2005-2007 JVoiceXML group.