Oracle Fusion Middleware Java API Reference for Oracle ADF Model
11g Release 1 (11.1.1)

E10653-04

oracle.adf.model.adapter
Class AdapterDefinition

java.lang.Object
  extended by oracle.adf.model.adapter.AdapterDefinition

public class AdapterDefinition
extends java.lang.Object

Adapter definition contains the definitions of the adapters available for the system. Adapters are the drivers that can handle different data sources to connect and execute queries. Data controls use adapters to connect to data sources.

Adapter definition defines the class name that implements the adapter. It also defines the data source type that it can handle. The data source type information contains the class name that represent a data source in the JDeveloper connection navigator.

Every adapter implementation must have a definition file defined for it. The definition file must be named as adapter-definition.xml. The file should be in the application class path under the folder meta-inf.

Adapter definitions are loaded once per JVM. The initialize()() method call triggers the loading of the files, if it's not already loaded by another thread. Once loaded the information is shared across different thread running for the JVM.


Field Summary
static java.lang.String ATTR_JDEV_CTX_HOOK_CLASS
           
static java.lang.String ATTR_JDEV_NODE
          Attribute name to get the JDev class name for the node that the adapter can handle.
static java.lang.String ATTR_LOCATION
           
static java.lang.String ATTR_NS
           
static java.lang.String ATTR_PATH
           
static java.lang.String ATTR_PROP_NAME
           
static java.lang.String ATTR_PROP_VALUE
           
static java.lang.String ATTR_TYPE_CLASS
           
static java.lang.String ATTR_TYPE_NAME
           
static java.lang.String DEF_FILE
           
static java.lang.String TAG_ADAPTER
          Tag name for adapter.
static java.lang.String TAG_DEPENDENCIES
          Tag "Dependencies".
static java.lang.String TAG_JDEV_CTX_HOOK
          Tag "JDevHook".
static java.lang.String TAG_LIBRARY
           
static java.lang.String TAG_PROPERTIES
          Tag "Properties"
static java.lang.String TAG_PROPERTY
           
static java.lang.String TAG_SCHEMA
          Tag "Schema".
static java.lang.String TAG_SOURCE_TYPE
          Tag "Source".
static java.lang.String TAG_TYPE
           
 
Method Summary
 boolean canHandle(java.lang.Object obj)
          Checks if a specific data source type can be handled by this adapter.
 AbstractAdapter createAdapterInstance()
          Creates an instance of the adapter by loading the adapter class.
static java.util.Iterator enumAdapters()
          Enumerates all adapters defined for the system.
 java.util.Iterator enumSchemaLocations()
          Enumerates all namespace locations defined for the adapter.
 java.util.Iterator enumSchemaNS()
          Enumerates all namespace names defined for the adapter.
 java.lang.String getClassName()
          Gets the class name of the adapter.
static AdapterDefinition getDefinition(java.lang.String typeName)
          Returns the definition object for a type name.
 java.lang.String getJDevCtxHookName()
           
 java.util.Iterator getLibraries()
          Gets the library paths that the adapter depends on.
 java.lang.String getName()
          Gets the type name of the adapter.
 java.lang.String getPropertyValue(java.lang.String name)
          Gets the value of a property defined for the adapter.
 java.lang.String getSchemaLocation(java.lang.String ns)
          Gets the schema location.
 java.util.Iterator getSupportedSourceClasses()
          Gets the source type classes that this adapter can handle.
 java.util.Iterator getSupportedSourceNames()
          Gets the source type names that this adapter can handle.
 java.util.Iterator getSupportedSourceTypes()
          Gets the source types that this adapter can handle.
static void initialize()
          Initializes the definition system by loading the definitions.
static void setClassLoader(java.lang.ClassLoader cl)
          Sets the class loader that loads the adapter definition files from the class path.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEF_FILE

public static final java.lang.String DEF_FILE
See Also:
Constant Field Values

TAG_ADAPTER

public static final java.lang.String TAG_ADAPTER
Tag name for adapter.

See Also:
Constant Field Values

ATTR_TYPE_NAME

public static final java.lang.String ATTR_TYPE_NAME
See Also:
Constant Field Values

ATTR_TYPE_CLASS

public static final java.lang.String ATTR_TYPE_CLASS
See Also:
Constant Field Values

TAG_SOURCE_TYPE

public static final java.lang.String TAG_SOURCE_TYPE
Tag "Source".

See Also:
Constant Field Values

TAG_TYPE

public static final java.lang.String TAG_TYPE
See Also:
Constant Field Values

ATTR_JDEV_NODE

public static final java.lang.String ATTR_JDEV_NODE
Attribute name to get the JDev class name for the node that the adapter can handle.

See Also:
Constant Field Values

TAG_SCHEMA

public static final java.lang.String TAG_SCHEMA
Tag "Schema".

See Also:
Constant Field Values

ATTR_NS

public static final java.lang.String ATTR_NS
See Also:
Constant Field Values

ATTR_LOCATION

public static final java.lang.String ATTR_LOCATION
See Also:
Constant Field Values

TAG_DEPENDENCIES

public static final java.lang.String TAG_DEPENDENCIES
Tag "Dependencies". Defines the libraries that the adapter RT will depend on.

See Also:
Constant Field Values

TAG_LIBRARY

public static final java.lang.String TAG_LIBRARY
See Also:
Constant Field Values

ATTR_PATH

public static final java.lang.String ATTR_PATH
See Also:
Constant Field Values

TAG_JDEV_CTX_HOOK

public static final java.lang.String TAG_JDEV_CTX_HOOK
Tag "JDevHook". It defines the class that provides the contextual info when a data control is selected in the structure pane.

See Also:
Constant Field Values

ATTR_JDEV_CTX_HOOK_CLASS

public static final java.lang.String ATTR_JDEV_CTX_HOOK_CLASS
See Also:
Constant Field Values

TAG_PROPERTIES

public static final java.lang.String TAG_PROPERTIES
Tag "Properties"

See Also:
Constant Field Values

TAG_PROPERTY

public static final java.lang.String TAG_PROPERTY
See Also:
Constant Field Values

ATTR_PROP_NAME

public static final java.lang.String ATTR_PROP_NAME
See Also:
Constant Field Values

ATTR_PROP_VALUE

public static final java.lang.String ATTR_PROP_VALUE
See Also:
Constant Field Values
Method Detail

initialize

public static void initialize()
Initializes the definition system by loading the definitions.


setClassLoader

public static void setClassLoader(java.lang.ClassLoader cl)
Sets the class loader that loads the adapter definition files from the class path.

Different IDE system can set the calss loader relavant for them. By default the calling thread's class loader will be used.


getDefinition

public static AdapterDefinition getDefinition(java.lang.String typeName)
Returns the definition object for a type name.

Parameters:
typeName - Name of the adapter type.
Returns:
Definition object for the type. If no definition is found for the type, it returns null.

enumAdapters

public static java.util.Iterator enumAdapters()
Enumerates all adapters defined for the system.

Returns:
An iterator of AdapterDefinition objects.

getName

public java.lang.String getName()
Gets the type name of the adapter.


enumSchemaNS

public java.util.Iterator enumSchemaNS()
Enumerates all namespace names defined for the adapter.

Returns:
An iterator of namespace name strings.

enumSchemaLocations

public java.util.Iterator enumSchemaLocations()
Enumerates all namespace locations defined for the adapter.

Returns:
An iterator of location strings.

getSchemaLocation

public java.lang.String getSchemaLocation(java.lang.String ns)
Gets the schema location.

Parameters:
ns - Namespace for the schema location.
Returns:
Namespace location. If not defined, returns null.

getJDevCtxHookName

public java.lang.String getJDevCtxHookName()

getPropertyValue

public java.lang.String getPropertyValue(java.lang.String name)
Gets the value of a property defined for the adapter.


getClassName

public java.lang.String getClassName()
Gets the class name of the adapter.


getLibraries

public java.util.Iterator getLibraries()
Gets the library paths that the adapter depends on.


createAdapterInstance

public AbstractAdapter createAdapterInstance()
Creates an instance of the adapter by loading the adapter class.

Returns:
A blank instance of the adapter.

getSupportedSourceNames

public java.util.Iterator getSupportedSourceNames()
Gets the source type names that this adapter can handle.

The source type names identify specific data source types for an application.

Returns:
An iterator of String that contains the source type names.

getSupportedSourceTypes

public java.util.Iterator getSupportedSourceTypes()
Gets the source types that this adapter can handle. Source types are the class name of the source that this adapter can handle.

Returns:
An iterator of String that contains the source type class names.

getSupportedSourceClasses

public java.util.Iterator getSupportedSourceClasses()
Gets the source type classes that this adapter can handle.

The source type classes identify specific data source types presented in the JDeveloper connection navigator window.

Returns:
An iterator of java.lang.Class representing nodes in the JDeveloper coinnection pane that this adapter can accept as a data source connection.

canHandle

public boolean canHandle(java.lang.Object obj)
Checks if a specific data source type can be handled by this adapter.

Parameters:
obj - The object that can be used as a data source connection node. It can either the name of the data source type or the node object that represents the data source in the JDeveloper connection navigator.

Oracle Fusion Middleware Java API Reference for Oracle ADF Model
11g Release 1 (11.1.1)

E10653-04

Copyright © 1997, 2010, Oracle. All rights reserved.