com.bea.dsp.dsmediator.client
Class DataServiceFactory

java.lang.Object
  extended bycom.bea.dsp.dsmediator.client.DataServiceFactory

public class DataServiceFactory
extends java.lang.Object

Factory class for creating local interfaces to data services. This factory class can be used to create data services and prepared statements for ad hoc queries, and perform remote write to file operations.

Example:
Hashtable h = new Hashtable();
h.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
h.put(Context.PROVIDER_URL,"t3://localhost:7001");
h.put(Context.SECURITY_PRINCIPAL,"weblogic");
h.put(Context.SECURITY_CREDENTIALS,"weblogic");
InitialContext ctx= new InitialContext(h);
DataService ds = DataServiceFactory.newDataService(ctx,"Demo_Application","ld:myxds/Xds");

TRANSACTION SUPPORT

User can also make the DataService transaction aware by putting a TRANSACTION attribute in the Environment. Transaction attribute can be either NotSupported (DataServiceFactory.ReadTransactionNotSupported) OR Required (DataServiceFactory.ReadTransactionRequired)

Example:
Hashtable h = new Hashtable();
h.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
h.put(Context.PROVIDER_URL,"t3://localhost:7001");
h.put(Context.SECURITY_PRINCIPAL,"weblogic");
h.put(Context.SECURITY_CREDENTIALS,"weblogic");
h.put(DataServiceFactory.ReadTransactionAttribute,DataServiceFactory.ReadTransactionRequired);
InitialContext ctx= new InitialContext(h);
DataService ds = DataServiceFactory.newDataService(ctx,"Demo_Application","ld:myxds/Xds");


Field Summary
static java.lang.String ReadTransactionAttribute
          Attribute name (passed as a Hashtable key to the InitialContext constructor) specifying the transaction awareness of read operations on a DataService.
static java.lang.String ReadTransactionNotSupported
          Attribute value (passed as a Hashtable value to the InitialContext constructor, keyed by DataServiceFactory.ReadTransactionAttribute) specifying that transactions are not supported.
static java.lang.String ReadTransactionRequired
          Attribute value (passed as a Hashtable value to the InitialContext constructor, keyed by DataServiceFactory.ReadTransactionAttribute) specifying that transactions are required.
 
Constructor Summary
DataServiceFactory()
           
 
Method Summary
static DataService newDataService(javax.naming.Context context, java.lang.String appName, java.lang.String xdsName)
          Factory method to create a data service instance.
static DataService newDataService(javax.naming.Context context, java.lang.String appName, java.lang.String xdsName, com.bea.dsp.dsmediator.client.SchemaTypeCache schemaTypeCache)
          Factory method to create a data service instance.
static StreamingDataService newStreamingDataService(javax.naming.Context context, java.lang.String appName, java.lang.String xdsName)
          Creates a streaming data service that can be used to get an XMLInputStream.
static PreparedExpression prepareExpression(javax.naming.Context context, java.lang.String appName, java.lang.String xquery)
          Used to create a prepared expression, which is an ad hoc query that can be executed against Liquid Data information.
static StreamingPreparedExpression streamingPreparedExpression(javax.naming.Context context, java.lang.String appName, java.lang.String xquery)
          Creates a streaming prepared expression that can be used to get an XMLInputStream for ad hoc queries.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ReadTransactionAttribute

public static final java.lang.String ReadTransactionAttribute
Attribute name (passed as a Hashtable key to the InitialContext constructor) specifying the transaction awareness of read operations on a DataService.

See Also:
Constant Field Values

ReadTransactionNotSupported

public static final java.lang.String ReadTransactionNotSupported
Attribute value (passed as a Hashtable value to the InitialContext constructor, keyed by DataServiceFactory.ReadTransactionAttribute) specifying that transactions are not supported.

See Also:
Constant Field Values

ReadTransactionRequired

public static final java.lang.String ReadTransactionRequired
Attribute value (passed as a Hashtable value to the InitialContext constructor, keyed by DataServiceFactory.ReadTransactionAttribute) specifying that transactions are required.

See Also:
Constant Field Values
Constructor Detail

DataServiceFactory

public DataServiceFactory()
Method Detail

newDataService

public static DataService newDataService(javax.naming.Context context,
                                         java.lang.String appName,
                                         java.lang.String xdsName)
Factory method to create a data service instance. Returns a proxy for the given application and Data Service URL passed

Parameters:
context - The WebLogic Server context
appName - The Liquid Data application name
xdsName - The data service name
Returns:
DataService A data service

newDataService

public static DataService newDataService(javax.naming.Context context,
                                         java.lang.String appName,
                                         java.lang.String xdsName,
                                         com.bea.dsp.dsmediator.client.SchemaTypeCache schemaTypeCache)
Factory method to create a data service instance. Returns a proxy for the given application and Data Service URL passed

Parameters:
context - The WebLogic Server context
appName - The Liquid Data application name
xdsName - The data service name
schemaTypeCache - The cache instance managed by user
Returns:
DataService A data service

prepareExpression

public static PreparedExpression prepareExpression(javax.naming.Context context,
                                                   java.lang.String appName,
                                                   java.lang.String xquery)
Used to create a prepared expression, which is an ad hoc query that can be executed against Liquid Data information. The query result is returned as an XmlObject.

Parameters:
context - The WebLogic Server context
appName - The application name
xquery - The XQuery to be executed
Returns:
a PreparedExpression

newStreamingDataService

public static StreamingDataService newStreamingDataService(javax.naming.Context context,
                                                           java.lang.String appName,
                                                           java.lang.String xdsName)
Creates a streaming data service that can be used to get an XMLInputStream. This is a reference to a local EJB interface, and cannot be used from a remote client.

Parameters:
context - The WebLogic Server context
appName - The application name
xdsName - The data service locator
Returns:
StreamingDataService
Throws:
javax.naming.NamingException

streamingPreparedExpression

public static StreamingPreparedExpression streamingPreparedExpression(javax.naming.Context context,
                                                                      java.lang.String appName,
                                                                      java.lang.String xquery)
Creates a streaming prepared expression that can be used to get an XMLInputStream for ad hoc queries. This is a reference to a local EJB interface, and cannot be used from a remote client.

Parameters:
context - The WebLogic Server context
appName - The application name
xquery - The XQuery to be executed
Returns:
StreamingPreparedExpression
Throws:
javax.naming.NamingException


Copyright © 2006 BEA Systems Inc. All Rights Reserved.