org.ceryle.xnode.util
Class XNodeOpener

java.lang.Object
  extended by java.lang.Thread
      extended by org.ceryle.xnode.util.XNodeOpener
All Implemented Interfaces:
Runnable

public class XNodeOpener
extends Thread

XNodeOpener extends java.lang.Thread to open files or documents via the XNodeStore, used by the XNodeShell sample application. This class was built by stripping all non-XNode content from ResourceOpener.

Since:
JDK1.3
Version:
$Id: XNodeOpener.java,v 1.1 2007-06-15 12:08:27 altheim Exp $
Author:
Murray Altheim

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
XNodeOpener(XNodeShell shell, XNodeID xnodeid)
          Constructor provided a parent XNodeShell and an XNodeID indicating the Collection ID and XNode ID.
 
Method Summary
 PlainDocument getDocument()
          Returns the PlainDocument opened, null if unavailable.
 XNode getXNode()
          Returns the XNode opened, null if unavailable.
 XNodeID getXNodeID()
          Returns the XNodeID of the opened document, null if unavailable.
 PlainDocument openNode(XNodeID xid, PlainDocument pdoc)
          Open the XNode indicated by the XNodeID xid.
 void run()
          Starts the thread by calling start().
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XNodeOpener

public XNodeOpener(XNodeShell shell,
                   XNodeID xnodeid)
            throws ProcessException
Constructor provided a parent XNodeShell and an XNodeID indicating the Collection ID and XNode ID.

Throws:
ProcessException
Method Detail

run

public void run()
Starts the thread by calling start().

Specified by:
run in interface Runnable
Overrides:
run in class Thread

getXNodeID

public XNodeID getXNodeID()
Returns the XNodeID of the opened document, null if unavailable. This will return null if the document failed to open.


getXNode

public XNode getXNode()
Returns the XNode opened, null if unavailable.


getDocument

public PlainDocument getDocument()
Returns the PlainDocument opened, null if unavailable.


openNode

public PlainDocument openNode(XNodeID xid,
                              PlainDocument pdoc)
                       throws XNodeException,
                              ProcessException
Open the XNode indicated by the XNodeID xid. If for some reason this fails, writes error messages and returns null. Returns the resulting PlainDocument.

Throws:
XNodeException
ProcessException


The Ceryle Project. Copyright ©2001-2007 Murray Altheim, All Rights Reserved. See LICENSE included with distribution.