Object factory for resource links for shared data sources.
| Modifier and Type | Class and Description |
|---|---|
| public static class | DataSourceLinkFactory.
Simple wrapper class that will allow a user to configure a ResourceLink for a data source
so that when |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Object | getObjectInstance(Object
The reference object describing the DataSource obj, Name The name of this object relative to name, Context nameCtx,
or null if no name is specified.The context relative to which the nameCtx, Hashtable<?, ?> name
parameter is specified, or null if name is
relative to the default initial context.The possibly null environment that is used in
creating the object. environment)Overrides org. Implements javax. Create a new DataSource instance. |
| public static void | setGlobalContext(Context
new global context value newGlobalContext)Hides org. Set the global context (note: can only be used once). |
| protected Object |
| DataSourceLinkFactory | back to summary |
|---|---|
| public DataSourceLinkFactory() | |
| getObjectInstance | back to summary |
|---|---|
| public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?, ?> environment) throws NamingException Overrides org. Implements javax. Create a new DataSource instance.
| |
| setGlobalContext | back to summary |
|---|---|
| public static void setGlobalContext(Context newGlobalContext) Hides org. Doc from org. Set the global context (note: can only be used once).
| |
| wrapDataSource | back to summary |
|---|---|
| protected Object wrapDataSource(Object datasource, String username, String password) throws NamingException | |
javax.sql.DataSource#getConnection() is called, it will invoke
javax.sql.DataSource#getConnection(String, String) with the preconfigured username and password.
| Modifier and Type | Field and Description |
|---|---|
| private final DataSource | |
| private final Method | |
| private final String | |
| private final String |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Object | invoke(Object
the proxy instance that the method was invoked on proxy, Method the method, Object[] Method instance corresponding to
the interface method invoked on the proxy instance. The declaring
class of the Method object will be the interface that
the method was declared in, which may be a superinterface of the
proxy interface that the proxy class inherits the method through.an array of objects containing the values of the
arguments passed in the method invocation on the proxy instance,
or args)null if interface method takes no arguments.
Arguments of primitive types are wrapped in instances of the
appropriate primitive wrapper class, such as
java.lang.Integer or java.lang.Boolean.Implements java. Processes a method invocation on a proxy instance and returns the result. |
| public Object |
| ds | back to summary |
|---|---|
| private final DataSource ds | |
| getConnection | back to summary |
|---|---|
| private final Method getConnection | |
| password | back to summary |
|---|---|
| private final String password | |
| username | back to summary |
|---|---|
| private final String username | |
| DataSourceHandler | back to summary |
|---|---|
| public DataSourceHandler(DataSource ds, String username, String password) throws Exception | |
| invoke | back to summary |
|---|---|
| public Object invoke(Object proxy, Method method, Object[] args) throws Throwable Implements java. Doc from java. Processes a method invocation on a proxy instance and returns the result. This method will be invoked on an invocation handler when a method is invoked on a proxy instance that it is associated with.
| |
| unwrap | back to summary |
|---|---|
| public Object unwrap(Class<?> iface) throws SQLException | |