|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.adobe.idp.Document
public class Document
The Document
class passes data of arbitrary size between
different LiveCycle services and components via remote RMI calls.
The Document
can also be used to store the data in process maps.
These are the main features of the Document
class:
Document
content can be supplied or retrieved using various types:
java.io.InputStream
, com.adobe.service.DataBuffer
, a file, or
any in-memory object that provides special read or write routines. The
content can also be supplied with a byte array. Document
is a Java serializable type, so it can be passed over
an RMI call (as opposed to java.io.InputStream
). The receiving side
can be collocated (same host, same class loader), local (same host,
different class loader or an application server instance), or
remote (different host). Passing of the Document
content is optimized for
each case (for example, if the sender and receiver are located on
the same host, the content is passed over a local file). Document
, the data
is either stored in memory as part of the Document
object, or saved
on the disk as a file. Document
collocate and share the same transaction, the in-memory object
is passed directly with no extra serialization. Document
content are
removed automatically upon the Document
disposal. The Document
instance
can be configured to be automatically disposed of by a timeout expiration,
or by binding the Document
lifetime to the current J2EE transaction. Below are some examples how to use the Document
class.
java.io.InputStream is = new java.io.StringBufferInputStream("..."));
Document input = new Document(is);
input.passivate(); // save all data supplied by the input stream
someLiveCycleService.loadInputData(input);
someLiveCycleService.someBusinessMethod();
Document output = someLiveCycleService.saveOutputData();
java.io.InputStream resultStream = output.getInputStream();
...
Note that the input.passivate
call is optional. It simply
guarantees that the input stream was fully read and detached from the
Document
instance. Without this call, reading the input stream is delayed
until the data is requested, which in this case happens somewhere inside
the someLiveCycleService.loadInputData
call. Document
APIs:
Document input = new Document(new File("..."), true); // intending to own this file
// ensure that the input document is disposed of upon the transaction end
input.setTransactionBound(true);
input.passivate(); // save all data supplied by the file and take over the file
someLiveCycleService.loadInputData(data);
someLiveCycleService.someBusinessMethod();
Document middle = someLiveCycleService.saveOutputData();
// ensure that the middle document is available for a long enough period of time
middle.setDisposalTimeout(middle.getDisposalTimeout() + 60); // add extra 60 seconds
anotherLiveCycleService.loadInputData(data);
anotherLiveCycleService.loadInputData2(middle);
anotherLiveCycleService.anotherBusinessMethod();
Document output = anotherLiveCycleService.saveOutputData();
com.adobe.service.DataBuffer dataBuffer = output.getDataBuffer();
...
As an indication of an error condition, any method of the Document
class
may throw a DocumentError
exception. The DocumentError
class is a runtime
exception (it inherits from java.lang.RuntimeException
). Runtime exceptions
are also known as unchecked exceptions, as they don't need to be defined
in the signature of the method throwing it. The unchecked exceptions (as
opposed to checked exceptions which inherit from java.lang.Exception
) simplify
the user's code by trading off some type safety.
The following Document
parameters are exposed through an external configuration:
Name | Type | Default | Description |
---|---|---|---|
localDocumentStorageSweepInterval | positive integer | 15 |
The amount of time in seconds between attempts to delete any files that are no longer needed and that were used to pass the document data between LiveCycle components running on the same machine. |
globalDocumentStorageSweepInterval | positive integer | 30 |
The amount of time in seconds between attempts to delete any files that are no longer needed that were used to pass the document data between LiveCycle components running on different machines. Specify this property only when deploying LiveCycle products in a clustered environment. |
globalDocumentStorageRootDir | string path | none | A path to an NFS shared directory used to store long-lived documents (the documents that are involved in a workflow process) and to share them among all cluster nodes. Specify this property only when deploying LiveCycle products in a clustered environment. |
globalDocumentStorageForceNFS | true/false | false |
A switch controlling whether to use the NFS protocol to pass documents between different LiveCycle components. The NFS protocol must be used when deploying LiveCycle products in a clustered environment on Microsoft Windows. Note that additional NFS software should be installed on your Windows machine before enabling this option. This option does not affect UNIX deployments. |
defaultDocumentMaxInlineSize | positive integer | 65536 |
The maximum number of bytes that are kept in memory when passing documents between different LiveCycle components. The documents that exceed this maximum are swapped out to the disk drive. Use this property for performance tuning. |
defaultDocumentDisposalTimeout | positive integer | 600 |
The maximum amount of time in seconds during which a document, which is passed between different LiveCycle components, is considered alive. After this time has passed, any files used to store this document are subject to removal. Use this property to control the use of disk space. |
When using the Document
class in the J2EE environment, the configuration parameters above are specified using
Adobe Configuration Manager. When using the Document
class in a standalone Java client, specify these
parameters as Java system properties with a com.adobe.idp
prefix (for example, com.adobe.idp.globalDocumentStorageRootDir
).
Constructor Summary | |
---|---|
Document(byte[] data)
Creates a new Document out of the content specified by the byte array. |
|
Document(com.adobe.service.DataBuffer db)
Deprecated. |
|
Document(Document doc)
Creates a copy of the Document supplied as input. |
|
Document(com.adobe.idp.DocumentStringType stringType,
java.lang.String string,
com.adobe.idp.DocumentPassivationClientFactory passivationClientFactory)
Creates a new Document out of the content accessible via a URI or
(in the future) other strings. |
|
Document(com.adobe.idp.DocumentWriter writer,
java.lang.Object obj)
Deprecated. |
|
Document(java.io.File file,
boolean own)
Creates a new Document out of the content stored in the file. |
|
Document(java.io.InputStream is)
Creates a new Document with the content provided by the java.io.InputStream object. |
|
Document(java.net.URI uri,
com.adobe.idp.DocumentPassivationClientFactory passivationClientFactory)
Creates a new Document out of the content accessible via a URI. |
|
Document(java.net.URL url)
Creates a new Document out of the content accessible via the URL. |
Method Summary | |
---|---|
void |
copyToFile(java.io.File file)
Copies the document content to a file specified by a caller. |
void |
dispose()
Disposes of any local temporary storage resources (for example, file, database data, and so on) occupied by the document content. |
void |
doneReading()
Closes any resources opened by the Document object while reading
the content with any of the Document object's read() methods. |
java.io.Serializable |
getAttribute(java.lang.String name)
Returns the value of an attribute with a given name. |
java.lang.String |
getContentType()
Returns the current MIME type of the Document content. |
static java.lang.String |
getContentTypeForFilename(java.lang.String path)
Returns the MIME type found in the mappings for the extension found at the end of path. |
com.adobe.service.DataBuffer |
getDataBuffer()
Deprecated. For internal use only. |
static int |
getDefaultDisposalTimeout()
Returns the default disposal timeout value. |
static int |
getDefaultMaxInlineSize()
Returns the default maximum size of the document content that can be embedded within the Document object. |
int |
getDisposalTimeout()
Returns the timeout value if it was set using the Document.setDisposalTimeout(int)
method. |
java.io.File |
getFile()
|
static javax.naming.InitialContext |
getInitialContext()
|
java.io.InputStream |
getInputStream()
Returns the document content in a java.io.InputStream object. |
int |
getMaxInlineSize()
Returns the maximum size of the document content that can be embedded within the Document instance. |
java.lang.Object |
getObject(com.adobe.idp.DocumentReader reader)
Deprecated. For internal use only. |
void |
init(java.io.File file,
com.adobe.idp.DocumentFileInitMode inMode)
|
static boolean |
isLocalizable()
|
static boolean |
isPassivationLazy()
Returns true if lazy passivation is on. |
boolean |
isTransactionBound()
Returns true or false depending on whether the Document lifetime is
transaction-bound. |
long |
length()
Returns the Document content's length. |
java.util.Set |
listAttributes()
Lists the names of all attributes associated with this Document instance. |
void |
passivate()
Saves the document content into some persistent form (file, database BLOB, and so on). |
void |
passivateGlobally()
Passivates the Document content (similar to the Document.passivate() method) in
the global storage. |
int |
read(long pos)
Reads a byte of the Document object's content at the given position. |
int |
read(long pos,
byte[] b,
int off,
int len)
Reads up to len bytes of the Document object's content into an array of bytes. |
void |
removeAttribute(java.lang.String name)
Removes an attribute with the given name. |
void |
setAttribute(java.lang.String name,
java.io.Serializable value)
Sets the value of an attribute with a given name. |
void |
setContentType(java.lang.String type)
Overwrites the current MIME type of the Document content. |
java.lang.String |
setContentTypeFromBasename()
Sets the MIME type of the Document from the current basename
derived from the last filename set. |
static void |
setDefaultDisposalTimeout(int seconds)
Sets the default disposal timeout value, which is used if the timeout is not set using the Document.setDisposalTimeout(int) method. |
static void |
setDefaultMaxInlineSize(int bytes)
Sets the default maximum size of the document content that can be embedded within the Document instance. |
void |
setDisposalTimeout(int seconds)
Sets the amount of time (in seconds) before the Document object is
disposed of automatically. |
static void |
setInitialContext(javax.naming.InitialContext ic)
Use this method to set the InitialContext needed by the Document object
in order to look up an internal server EJB, which is used to upload the Document object's content
to the LiveCycle server. |
void |
setMaxInlineSize(int bytes)
Sets the maximum size of the document content that can be embedded within the Document instance. |
static void |
setPassivationLazy(boolean enable)
Use this method to override the default passivation behavior. |
void |
setTransactionBound(boolean value)
Used to specify whether the Document is transaction-bound. |
java.lang.String |
toString()
Returns a text representation of the Document internal state. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Document(byte[] data)
Document
out of the content specified by the byte array.
In this case, the new Document
simply keeps a reference to the input
array. So, the input source should remain available until the Document
content is passivated (saved to permanent storage). The passivation
happens either explicitly when Document.passivate()
is called, or
implicitly when one tries to read the Document
object's content (for example,
when Document.getInputStream()
, Document.getFile()
, or another access
method is called). Implicit passivation can be triggered either locally
(when the access method is called on the same Document
instance that
was created with this constructor), or remotely (when the access method
is called on another Document
instance that is a copy of the source
Document
instance done via a serialization or deserialization or passed via
a remote RMI call).
data
- The byte array providing the input content.public Document(java.io.InputStream is)
Document
with the content provided by the java.io.InputStream
object.
In this case, the new Document
simply keeps a reference to the input
stream. So, the input source should remain available until the Document
content is passivated (saved to permanent storage). The passivation
happens either explicitly when Document.passivate()
is called, or
implicitly when one tries to read the Document
object's content (for example,
when Document.getInputStream()
, Document.getFile()
, or another access
method is called). Implicit passivation can be triggered either locally
(when the access method is called on the same Document
instance that
was created with this constructor), or remotely (when the access method
is called on another Document
instance that is a copy of the source
Document
instance done via a serialization or deserialization or passed via
a remote RMI call).
is
- The java.io.InputStream
object providing the input content.public Document(java.net.URL url)
Document
out of the content accessible via the URL.
In this case, the new Document
simply keeps a reference to the input
URL. So, the input source should remain available until the Document
content is passivated (saved to permanent storage). The passivation
happens either explicitly when Document.passivate()
is called, or
implicitly when one tries to read the Document
object's content (for example,
when Document.getInputStream()
, Document.getFile()
, or another access
method is called). Implicit passivation can be triggered either locally
(when the access method is called on the same Document
instance that
was created with this constructor), or remotely (when the access method
is called on another Document
instance that is a copy of the source
Document
instance done via a serialization or deserialization or passed via
a remote RMI call).
url
- The URL to the input content.public Document(com.adobe.idp.DocumentStringType stringType, java.lang.String string, com.adobe.idp.DocumentPassivationClientFactory passivationClientFactory)
Document
out of the content accessible via a URI or
(in the future) other strings.
A string interface is provided as the java.net.URI class can be quite pedantic
about URI syntax where other consumers of URIs may not be as pedantic.
In the case of a URI, the new Document
simply keeps a reference
to the input URI. So, the input source should remain available until the
Document
content is passivated. The passivation happens either explicitly
when Document.passivate()
is called, or implicitly when one tries to read the
Document
object's content (for example, when Document.getInputStream()
,
Document.getFile()
, or another access method is called). Implicit passivation can
be triggered either locally (when the access method is called on the same
Document
instance that was created with this constructor),
or remotely (when the access method is called on another Document
instance that is a copy of the source Document
instance done via
a serialization or deserialization or passed via a remote RMI call).
stringType
- a DocumentStringType value, presently only DocumentStringType.URI_STRING.string
- The uri to look up.passivationClientFactory
- The passivationFactory to use, or null if it is known
that the Document will be passed to the server before passivation. Can be left null on the server.public Document(java.net.URI uri, com.adobe.idp.DocumentPassivationClientFactory passivationClientFactory)
Document
out of the content accessible via a URI.
In the case of a URI, the new Document
simply keeps a reference
to the input URI. So, the input source should remain available until the
Document
content is passivated. The passivation happens either explicitly
when Document.passivate()
is called, or implicitly when one tries to read the
Document
object's content (for example, when Document.getInputStream()
,
Document.getFile()
, or another access method is called). Implicit passivation can
be triggered either locally (when the access method is called on the same
Document
instance that was created with this constructor),
or remotely (when the access method is called on another Document
instance that is a copy of the source Document
instance done via
a serialization or deserialization or passed via a remote RMI call).
Since some URIs such as repository URIs may require contacting the server and may also require authentication and authorization a com.adobe.idp.dsc.clientsdk.ServiceClientFactory can be supplied as the DocumentPassivationClientFactory to provide authentication and server connection information.
string
- The uri to look up.passivationClientFactory
- The passivationFactory to use, or null if it is known
that the Document will be passed to the server before passivation. Can be left null on the server.public Document(java.io.File file, boolean own)
Document
out of the content stored in the file.
In this case, the new Document
simply keeps a reference to the input
file. So, the input source should remain available until the Document
content is passivated (saved to permanent storage). The passivation
happens either explicitly when Document.passivate()
is called, or
implicitly when one tries to read the Document
object's content (for example,
when Document.getInputStream()
, Document.getFile()
, or another access
method is called). Implicit passivation can be triggered either locally
(when the access method is called on the same Document
instance that
was created with this constructor), or remotely (when the access method
is called on another Document
instance that is a copy of the source
Document
instance done via a serialization or deserialization or passed via
a remote RMI call).
Setting the own
flag to true
means that the file will be
deleted automatically when the Document instance is passivated. This can
help to optimize IO, since the file can be moved rather than copied
(which happens when the own
flag is false
) into the managed area
on the disk.
file
- The file providing the input content.own
- The boolean
flag controlling whether the new Document
should
take over the file when the Document
is passivated.public Document(com.adobe.service.DataBuffer db)
public Document(com.adobe.idp.DocumentWriter writer, java.lang.Object obj)
public Document(Document doc)
Document
supplied as input.
doc
- The source Document
instance.Method Detail |
---|
public void init(java.io.File file, com.adobe.idp.DocumentFileInitMode inMode)
public void passivate()
Document
no longer keeps
a reference to the object that provided the input for the document
content (for example, the byte
array, the java.io.InputStream
, or the file
provided by the corresponding Document
constructor calls).
public void passivateGlobally()
Document
content (similar to the Document.passivate()
method) in
the global storage.
public int read(long pos)
Document
object's content at the given position.
pos
- The position from which to read the byte.
0
to 255
,
or -1
if the end of the data has been reached.public void doneReading()
Document
object while reading
the content with any of the Document
object's read()
methods.
This method is also called by the Document.dispose()
method.
Document.read(long)
,
Document.read(long, byte[], int, int)
,
Document.dispose()
public int read(long pos, byte[] b, int off, int len)
len
bytes of the Document
object's content into an array of bytes.
While this method attempts to read as many as len
bytes, a smaller number (0
to len
bytes)
may be read.
The very first call of this method passivates the Document
.
If the content is not stored in memory as part of the Document
object, the very first call of this method
also opens an internal resource, such as java.io.RandomAccessFile, to read the data. Thus, to help prevent resource leakage,
it is important to call Document.doneReading()
when finished reading.
pos
- The position from which to read the bytes.b
- The buffer into which the data is read.off
- The starting index in the buffer (b
) to which the data is written.len
- The maximum number of bytes to read.
-1
if
the end of the data has been reached.public long length()
Document
content's length. This method passivates
the Document
content internally using the Document.passivate()
method to
cover the cases when the length is not known a priori (for example, when the
Document
is created with data whose length is unknown until the content
is fully read, such as java.io.InpuStream
or java.net.URL
).
Document
content's length.Document.passivate()
public java.io.InputStream getInputStream()
java.io.InputStream
object.
java.io.InputStream
object containing the document content.public java.io.File getFile()
public void copyToFile(java.io.File file)
Note that after this method returns, it becomes the caller's responsibility to remove the file.
file
- The file to which to copy the document content. If the file
exists, this method will overwrite it. If the file does not
exist, this method will create one.public com.adobe.service.DataBuffer getDataBuffer()
public java.lang.Object getObject(com.adobe.idp.DocumentReader reader)
public void setDisposalTimeout(int seconds)
Document
object is
disposed of automatically. Use this method to guarantee disposal of any
local temporary storage resources (for example, file, database data, and so on) occupied by
the document content after a particular time elapsed. After the Document
is disposed of, its content will no longer be available.
The recommended usage is document.setDisposalTimeout(document.getDisposalTimeout()
+ extraTime)
. Thus, changing the default disposal timeout at
start-up can still affect the local disposal timeout.
The Document
can also be disposed of either explicitly,
when the Document.dispose()
method is called, or implicitly, when
the current transaction ends and the Document
is set as transaction-bound
using the Document.setTransactionBound(boolean)
method.
If this method is never called, the Document
is assigned a default
disposal timeout (see the static Document.getDefaultDisposalTimeout()
method).
seconds
- The new disposal timeout in seconds.Document.dispose()
,
Document.setTransactionBound(boolean)
public int getDisposalTimeout()
Document.setDisposalTimeout(int)
method. Otherwise, it returns the default timeout value (see the static
Document.getDefaultDisposalTimeout()
method).
Document.setDisposalTimeout(int)
public static void setDefaultDisposalTimeout(int seconds)
Document.setDisposalTimeout(int)
method.
seconds
- The new default disposal timeout.public static int getDefaultDisposalTimeout()
defaultDocumentDisposalTimeout
property. The default
timeout is 600
seconds.
Document.setDefaultDisposalTimeout(int)
public void setTransactionBound(boolean value)
Document
is transaction-bound.
If this method is called with value
set to true
, the
Document
instance is automatically disposed of upon the end of the
transaction associated with the current thread (the Document
becomes
transaction-bound). By default, the Document
is not transaction-bound.
When calling this method with the value
set to true
, make
sure that the calling thread is associated with a J2EE transaction context.
Otherwise, a DocumentError
exception will be thrown.
The Document
can also be disposed of in a few other ways.
It can be disposed of explicitly, via the Document.dispose()
method call,
or automatically: when the disposal timeout expires, or when
the transaction ends (whichever happens earlier).
value
- The boolean value specifying whether the Document
is
transaction-bound.Document.dispose()
,
Document.setDisposalTimeout(int)
public boolean isTransactionBound()
true
or false
depending on whether the Document
lifetime is
transaction-bound.
Document
is transaction-bound.Document.setTransactionBound(boolean)
public void setMaxInlineSize(int bytes)
Document
instance. If this value is not set, the default value
controlled by the Document.setDefaultMaxInlineSize(int)
method is used.
bytes
- The maximum inline size in bytes.Document.getMaxInlineSize()
,
Document.setDefaultMaxInlineSize(int)
public int getMaxInlineSize()
Document
instance. If this value is not set with the
Document.setMaxInlineSize(int)
method, the default value is controlled by
the Document.setDefaultMaxInlineSize(int)
method.
Document.setMaxInlineSize(int)
,
Document.setDefaultMaxInlineSize(int)
public static void setDefaultMaxInlineSize(int bytes)
Document
instance.
bytes
- The default maximum inline size in bytes.Document.setMaxInlineSize(int)
,
Document.getDefaultMaxInlineSize()
public static int getDefaultMaxInlineSize()
Document
object.
If the default inline size is not set using the
Document.setDefaultMaxInlineSize(int)
method, this method uses a value of a
configurable defaultDocumentMaxInlineSize
property.
The default value is 64 Kbytes.
Document.getMaxInlineSize()
,
Document.setDefaultMaxInlineSize(int)
public void setContentType(java.lang.String type)
Document
content.
The content type is a MIME string identifying the Document
content
(for example, "application/octet-stream"
, "text/plain"
, and so on).
type
- The new content type.Document.getContentType()
public java.lang.String setContentTypeFromBasename()
Document
from the current basename
derived from the last filename set.
public static java.lang.String getContentTypeForFilename(java.lang.String path)
path
- a filename/path.
public java.lang.String getContentType()
Document
content.
The content type is a MIME string identifying the Document
content
(for example, "application/octet-stream", "text/plain", and so on). The content type
is set either explicitly using the #setContentType()
method, or
implicitly when the Document.Document(java.net.URL)
, Document.Document(File, boolean)
, or
Document.Document(java.io.InputStream)
constructor is called. To determine the content type, the first and second
constructors use a file/URL extension to map it to the MIME content type
using a default javax.activation.FileTypeMap
instance. The third
constructor requests the content type from DataBuffer
using the
DataBuffer.getContentType()
method.
If the Document is created using the Document.Document(java.net.URL)
constructor, this method will return null unless/until the Document is passivated.
This allows the source of the content to specify the content type.
If such behavior is not acceptable, consider setting
the content type on the new Document
instance explicitly, using the
#setContentType()
method, perhaps in conjunction with the
#Document.getContentTypeForFilename(String path)
method.
If the Document is created using the #com.adobe.idp.Document.Document(DocumentStringType, String, DocumentPassivationClientFactory)
constructor or the #com.adobe.idp.Document.Document(URI, DocumentPassivationClientFactory)
constructor then the string/URI will be internally passivated so that the repository can supply the content type.
null
if the content
type is unknown.#setContentType()
public void setAttribute(java.lang.String name, java.io.Serializable value)
name
- The attribute name.value
- The attribute value.#getAttribute()
,
#removeAttribute()
,
Document.listAttributes()
public java.io.Serializable getAttribute(java.lang.String name)
An attribute is an arbitrary (preferably small) serializable object passed
along with the Document
instance. Every attribute should have a unique
name. The predefined attributes are:
Attribute | Description |
---|---|
file | The original file name (as a string), if the Document was created
with the Document.Document(File, boolean) constructor, or the "file" attribute was set explicitly. |
wsfilename | A legacy compatibility alias for the "file" attribute. New code should use the "file" attribute. The "file" and "wsfilename" attributes will always have the same value. Setting either one will reset the value of the "basename" attribute. Setting the "basename" attribute will reset both "file" and "wsfilename" to the same value as "basename". |
basename | The original base file name (as a string) if either the file or url attributes are available. The base file name is the name without any leading path information, i.e. the part of the filename after the last '\' or '/' (whichever comes later). If no '/' or '\' is present the whole filename will be used as the base name. This attribute is set whenever the file, wsfilename, or url attributes are set. Setting this attribute will set the file and wsfilename attributes to the same value. |
url | The original URL (as a string), if the Document
was created with the Document.Document(java.net.URL) constructor, or the "url" attribute was set explicitly. Setting this
attribute will reset "basename" as well. If the part of the URL after the last '/' if any can be interpretted as a URI
and decoded, that value will be used as the basename. Otherwise the part of the URL after the last '/' if any will be
used as-is. If no '/' is present the whole URL is used as the base name. |
name
- The attribute name.
#setAttribute()
,
#removeAttribute()
,
Document.listAttributes()
public void removeAttribute(java.lang.String name)
name
- The attribute name.#setAttribute()
,
#getAttribute()
,
Document.listAttributes()
public java.util.Set listAttributes()
Document
instance.
#getAttribute()
,
#setAttribute()
,
#removeAttribute()
public void dispose()
Document
instance becomes invalid, meaning that it becomes impossible to use the Document
for any purpose.
In a few cases the Document
can also be disposed of
automatically. This occurs when the disposal timeout ends, which is set using the Document.setDisposalTimeout(int)
method, or when the current transaction ends and the Document
is set
as transaction-bound using the Document.setTransactionBound(boolean)
method.
Document.setDisposalTimeout(int)
,
Document.setTransactionBound(boolean)
public static boolean isLocalizable()
public static boolean isPassivationLazy()
true
if lazy passivation is on. If this is the case, the Document
content
is not passivated until the receiving side requests the content
(unless it is passivated explicitly via the passivate() call). If it is off,
the Document
is passivated during its serialization (for example, when making
an RMI/EJB call with a Document
object as an input parameter).
Lazy passivation is a default behavior within the J2EE environment.
For standalone J2SE applications, lazy passivation is off by
default. This is because the lazy passivation might require a remote
callback from the side receiving the Document
object to the side supplying
one. Such a callback might be problematic for standalone J2SE applications
(for example, because the supplier side is behind a network firewall, or because
the secure connection is a must but the supplier side does not support the SSL
protocol in the callback direction).
true
if the lazy passivation is on; false
otherwise.Document.setPassivationLazy(boolean)
public static void setPassivationLazy(boolean enable)
enable
- Set to true
to enable lazy passivation.Document.isPassivationLazy()
public java.lang.String toString()
Document
internal state.
Use this method for debugging only.
toString
in class java.lang.Object
java.lang.String
with the Document
internal state in XML format.public static void setInitialContext(javax.naming.InitialContext ic)
InitialContext
needed by the Document
object
in order to look up an internal server EJB, which is used to upload the Document
object's content
to the LiveCycle server. This method should be called by standalone
client applications at initialization time. If this method is not called,
the Document
object will use an InitialContext
object created with
an empty constructor.
public static javax.naming.InitialContext getInitialContext()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |