Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.bea.ld.dsmediator.client
Class DataServiceFactory

    java.lang.Object
      |
      +--com.bea.ld.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.ReadTransactionRequired,DataServiceFactory.ReadTransactionRequired);
InitialContext ctx= new InitialContext(h);
DataService ds = DataServiceFactory.newDataService(ctx,"Demo_Application","ld:myxds/Xds");

Field Summary
`static java.lang.String` | `ReadTransactionAttribute`
`static java.lang.String` | `ReadTransactionNotSupported`
`static java.lang.String` | `ReadTransactionRequired`

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 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
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### ReadTransactionAttribute

    public static final java.lang.String ReadTransactionAttribute

### ReadTransactionNotSupported

    public static final java.lang.String ReadTransactionNotSupported

### ReadTransactionRequired

    public static final java.lang.String ReadTransactionRequired

Constructor Detail

### DataServiceFactory

    public DataServiceFactory()

Method Detail

### newDataService

    public static DataService newDataService(javax.naming.Context context,
                                             java.lang.String appName,
                                             java.lang.String xdsName)
                                      throws java.lang.Exception

  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
  Throws:
    java.lang.Exception -

### 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)
                                                        throws javax.naming.NamingException,
                                                               com.bea.ld.dsmediator.client.exception.ServerPrepareException

  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 -
    com.bea.ld.dsmediator.client.exception.ServerPrepareException -

### streamingPreparedExpression

    public static StreamingPreparedExpression streamingPreparedExpression(javax.naming.Context context,
                                                                          java.lang.String appName,
                                                                          java.lang.String xquery)
                                                                   throws javax.naming.NamingException,
                                                                          com.bea.ld.dsmediator.client.exception.ServerPrepareException

  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 -
    com.bea.ld.dsmediator.client.exception.ServerPrepareException -

Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2005 Bea Systems Inc. All Rights Reserved.`