org.jvoicexml.client.jndi
Class JVoiceXmlStub

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

public final class JVoiceXmlStub
extends Object
implements JVoiceXml

Stub for JVoiceXml.

Since:
0.4
Version:
$Revision: 2430 $
Author:
Dirk Schnelle-Walka
See Also:
JVoiceXml

Constructor Summary
JVoiceXmlStub()
          Constructs a new object.
JVoiceXmlStub(Context context)
          Constructs a new object.
 
Method Summary
protected  void clearSkeleton()
          Clears a known remote reference to the skeleton.
 Session createSession(ConnectionInformation client)
          Creates a new session.
 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<RemoteJVoiceXml> 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.
 String getVersion()
          Retrieves the version information of JVoiceXml.
 void setContext(Context ctx)
          Sets the JNDI context.
 void shutdown()
          Shuts down the interpreter and frees all resources.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JVoiceXmlStub

public JVoiceXmlStub()
Constructs a new object.


JVoiceXmlStub

public JVoiceXmlStub(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<RemoteJVoiceXml> 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.

getVersion

public String getVersion()
Retrieves the version information of JVoiceXml.

Specified by:
getVersion in interface JVoiceXml
Returns:
Version number.

createSession

public Session createSession(ConnectionInformation client)
                      throws ErrorEvent
Creates a new session.

The Session is the entry point to start the interpreter. A session is obtained by a ConnectionInformation.

Specified by:
createSession in interface JVoiceXml
Parameters:
client - information about the current connection, maybe null. If it is null the default implementation platform is used.
Returns:
The new session.
Throws:
ErrorEvent - Error creating the session.

shutdown

public void shutdown()
Shuts down the interpreter and frees all resources.

Specified by:
shutdown in interface JVoiceXml

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-2010JVoiceXML group.