WebLogic Integration


com.bea.wlai.client
Class DesignTimeHelper

java.lang.Object
  |
  +--com.bea.wlai.client.DesignTimeHelper

public class DesignTimeHelper
extends java.lang.Object
implements java.io.Serializable

This class provides utility methods for interacting with the AI client manager EJBs for doing common design time tasks. This class is helpful for other environments outside the standard design-time framework provided by WLI.

Author:
Copyright © 2000, 2001 BEA Systems, Inc. All Rights Reserved.
See Also:
Serialized Form

Field Summary
static java.lang.String CONNECTION_FACTORY_MANAGER
           
static java.lang.String DEPLOY_MANAGER
           
protected  java.util.Hashtable m_jndiEnv
           
static java.lang.String NAMESPACE_MANAGER
           
static java.lang.String SCHEMA_MANAGER
           
protected  ApplicationViewManager t_appViewManager
           
protected  ConnectionFactoryManager t_connectionFactoryManager
           
protected  DeployManager t_deployManager
           
protected  javax.naming.Context t_jndiContext
           
protected  NamespaceManager t_namespaceManager
           
protected  com.bea.document.internal.ClasspathEntityResolver t_resolver
           
protected  SchemaManager t_schemaManager
           
 
Constructor Summary
DesignTimeHelper()
          Constructor for server-side components that can establish an InitialContext without any JNDI environment properties.
DesignTimeHelper(javax.naming.Context context)
          Constructor for client-side components that already have a JNDI context
DesignTimeHelper(java.util.Hashtable jndiEnv)
          Constructor for client-side components that need to establish JNDI environment properties to obtain an InitialContext
 
Method Summary
 void addEventSchemaToRepository(IApplicationViewDescriptor avd, IEventDescriptor ed, IDocumentDefinition eventDef)
          Adds the schema for an event to the repository.
 IDocumentDescriptor addOrUpdateSchema(SchemaManager schemaManager, QualifiedName schemaQName, IDocumentDefinition def)
           
 void addServiceSchemasToRepository(IApplicationViewDescriptor avd, IServiceDescriptor sd, IDocumentDefinition requestDef, IDocumentDefinition responseDef)
          Adds the request and response schemas for a service to the repository.
 void close()
          Frees any resources held by this instance
 ApplicationView getApplicationView(java.lang.String strQualifiedName)
          Returns a deployed ApplicationView instance from strQualifiedName.
 IApplicationViewDescriptor getApplicationViewDescriptor(java.lang.String strQualifiedName)
           
 ApplicationViewManager getApplicationViewManager()
           
 IConnectionFactoryDescriptor getConnectionFactoryDescriptor(java.lang.String strQualifiedName)
           
 ConnectionFactoryManager getConnectionFactoryManager()
           
 java.lang.String getContent(IDocument doc, java.lang.String strPath, boolean bIsMandatory)
          Return the content of an XML element as a String
 DeployManager getDeployManager()
           
 org.xml.sax.EntityResolver getEntityResolver()
           
 IEventDefinition getEventDefinition(IEventDescriptor event)
           
 javax.naming.Context getJNDIContext()
           
 NamespaceManager getNamespaceManager()
           
 QualifiedName getQualifiedName(java.lang.String strQualifiedName)
          Get a QualifiedName for String strQualifiedName; this method will create namespaces as needed in order to fulfill the request.
 QualifiedName getQualifiedName(java.lang.String strQualifiedName, boolean bCreateIfNeeded)
          Get a QualifiedName for String strQualifiedName; if bCreateIfNeeded is true, then this method will create namespaces as needed in order to fulfill the request.
 SchemaManager getSchemaManager()
           
 IDocument readDocument(java.io.File f)
          Reads a document from a file
 IDocument readDocument(java.lang.String strFile)
          Reads a document from a file
 void removeExistingNamespace(QualifiedName namespaceQName, boolean bWarningsOnly)
          Tries to remove everything from a namespace gracefully...if bWarningsOnly is true, then an exception generated while attempting to remove a namespace object is treated as a warning, i.e.
 void writeDocument(IDocument doc, java.io.File f)
          Writes a document to a file; UTF-8 encoded
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONNECTION_FACTORY_MANAGER

public static final java.lang.String CONNECTION_FACTORY_MANAGER

NAMESPACE_MANAGER

public static final java.lang.String NAMESPACE_MANAGER

DEPLOY_MANAGER

public static final java.lang.String DEPLOY_MANAGER

SCHEMA_MANAGER

public static final java.lang.String SCHEMA_MANAGER

m_jndiEnv

protected java.util.Hashtable m_jndiEnv

t_appViewManager

protected transient ApplicationViewManager t_appViewManager

t_namespaceManager

protected transient NamespaceManager t_namespaceManager

t_connectionFactoryManager

protected transient ConnectionFactoryManager t_connectionFactoryManager

t_deployManager

protected transient DeployManager t_deployManager

t_schemaManager

protected transient SchemaManager t_schemaManager

t_resolver

protected transient com.bea.document.internal.ClasspathEntityResolver t_resolver

t_jndiContext

protected transient javax.naming.Context t_jndiContext
Constructor Detail

DesignTimeHelper

public DesignTimeHelper()
                 throws javax.naming.NamingException
Constructor for server-side components that can establish an InitialContext without any JNDI environment properties.

DesignTimeHelper

public DesignTimeHelper(java.util.Hashtable jndiEnv)
                 throws javax.naming.NamingException
Constructor for client-side components that need to establish JNDI environment properties to obtain an InitialContext

DesignTimeHelper

public DesignTimeHelper(javax.naming.Context context)
                 throws javax.naming.NamingException
Constructor for client-side components that already have a JNDI context
Method Detail

close

public void close()
Frees any resources held by this instance


getEntityResolver

public org.xml.sax.EntityResolver getEntityResolver()

Returns:
an XML entity resolver

getJNDIContext

public javax.naming.Context getJNDIContext()
                                    throws javax.naming.NamingException


getApplicationViewManager

public ApplicationViewManager getApplicationViewManager()
                                                 throws javax.naming.NamingException,
                                                        javax.ejb.CreateException,
                                                        java.rmi.RemoteException


getConnectionFactoryManager

public ConnectionFactoryManager getConnectionFactoryManager()
                                                     throws javax.naming.NamingException,
                                                            javax.ejb.CreateException,
                                                            java.rmi.RemoteException


getNamespaceManager

public NamespaceManager getNamespaceManager()
                                     throws javax.naming.NamingException,
                                            javax.ejb.CreateException,
                                            java.rmi.RemoteException,
                                            NamespaceException


getSchemaManager

public SchemaManager getSchemaManager()
                               throws javax.naming.NamingException,
                                      javax.ejb.CreateException,
                                      java.rmi.RemoteException


getDeployManager

public DeployManager getDeployManager()
                               throws javax.naming.NamingException,
                                      javax.ejb.CreateException,
                                      java.rmi.RemoteException


removeExistingNamespace

public void removeExistingNamespace(QualifiedName namespaceQName,
                                    boolean bWarningsOnly)
                             throws java.lang.Exception
Tries to remove everything from a namespace gracefully...if bWarningsOnly is true, then an exception generated while attempting to remove a namespace object is treated as a warning, i.e. pass "true" if you want to remove the namespace regardless of any problems encountered during the removal process; effectively a "kill -9"


addServiceSchemasToRepository

public void addServiceSchemasToRepository(IApplicationViewDescriptor avd,
                                          IServiceDescriptor sd,
                                          IDocumentDefinition requestDef,
                                          IDocumentDefinition responseDef)
                                   throws java.lang.Exception
Adds the request and response schemas for a service to the repository. The schemas are added in such a way to prevent the request from being in the repository and not the response, i.e. all or nothing. In addition, this method checks to see if the schema is already in the repository, and if it is, it is updated vs. causing duplicate key exceptions. This prevents us from getting a primary key constraint exception. In short, it is safe to call this method when either adding or editing a service, it takes care of the details. If all is well the IServiceDescriptor is updated to reflect the names of the schemas for the service.


addEventSchemaToRepository

public void addEventSchemaToRepository(IApplicationViewDescriptor avd,
                                       IEventDescriptor ed,
                                       IDocumentDefinition eventDef)
                                throws java.lang.Exception
Adds the schema for an event to the repository. This method checks to see if the schema is already in the repository and if it is, the schema is updated. In short, it is safe to call this method when either adding or editing an event, it takes care of the details.


addOrUpdateSchema

public IDocumentDescriptor addOrUpdateSchema(SchemaManager schemaManager,
                                             QualifiedName schemaQName,
                                             IDocumentDefinition def)
                                      throws java.lang.Exception

Returns:
an IDocumentDescriptor that describes a schema in the repository.

getQualifiedName

public QualifiedName getQualifiedName(java.lang.String strQualifiedName)
                               throws javax.ejb.CreateException,
                                      java.rmi.RemoteException,
                                      javax.naming.NamingException,
                                      NamespaceException
Get a QualifiedName for String strQualifiedName; this method will create namespaces as needed in order to fulfill the request.


getQualifiedName

public QualifiedName getQualifiedName(java.lang.String strQualifiedName,
                                      boolean bCreateIfNeeded)
                               throws javax.ejb.CreateException,
                                      java.rmi.RemoteException,
                                      javax.naming.NamingException,
                                      NamespaceException
Get a QualifiedName for String strQualifiedName; if bCreateIfNeeded is true, then this method will create namespaces as needed in order to fulfill the request.


getApplicationView

public ApplicationView getApplicationView(java.lang.String strQualifiedName)
                                   throws ApplicationViewException,
                                          javax.ejb.CreateException,
                                          java.rmi.RemoteException,
                                          javax.naming.NamingException,
                                          NamespaceException
Returns a deployed ApplicationView instance from strQualifiedName.

Returns:
a deployed ApplicationView instance; this method will fail if the underlying application view is not deployed.

getApplicationViewDescriptor

public IApplicationViewDescriptor getApplicationViewDescriptor(java.lang.String strQualifiedName)
                                                        throws ApplicationViewException,
                                                               DuplicateNameException,
                                                               javax.ejb.CreateException,
                                                               java.rmi.RemoteException,
                                                               javax.naming.NamingException,
                                                               NamespaceException


getConnectionFactoryDescriptor

public IConnectionFactoryDescriptor getConnectionFactoryDescriptor(java.lang.String strQualifiedName)
                                                            throws ConnectionFactoryException,
                                                                   DuplicateNameException,
                                                                   javax.ejb.CreateException,
                                                                   java.rmi.RemoteException,
                                                                   javax.naming.NamingException,
                                                                   NamespaceException


getEventDefinition

public IEventDefinition getEventDefinition(IEventDescriptor event)
                                    throws javax.naming.NamingException,
                                           javax.ejb.CreateException,
                                           java.rmi.RemoteException,
                                           NamespaceException,
                                           SchemaException

Returns:
an IEventDefinition for an existing event's schema

readDocument

public IDocument readDocument(java.lang.String strFile)
                       throws java.io.IOException,
                              DocumentException
Reads a document from a file

Parameters:
strFile - - name of a file containing a document; this is typically an application view or connection factory descriptor for design time.

readDocument

public IDocument readDocument(java.io.File f)
                       throws java.io.IOException,
                              DocumentException
Reads a document from a file

Parameters:
f - - file containing a document; this is typically an application view or connection factory descriptor for design time.

writeDocument

public void writeDocument(IDocument doc,
                          java.io.File f)
                   throws java.io.IOException,
                          DocumentException
Writes a document to a file; UTF-8 encoded


getContent

public java.lang.String getContent(IDocument doc,
                                   java.lang.String strPath,
                                   boolean bIsMandatory)
                            throws java.lang.Exception
Return the content of an XML element as a String

Parameters:
doc - - the document containing the desired content
strPath - - the XPath to the content
bIsMandatory - - true indicates that the content is required to be non-null, non-empty
Returns:
a String value for XML content
Throws:
java.lang.Exception - if the mandatory content is null or empty

WebLogic Integration

WebLogic Integration (WLI)