Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle ADF Model
11g Release 2 (11.1.2.2.0)

E17483-03


oracle.adf.model.connection.url
Class URLConnectionProxy

java.lang.Object
  extended by oracle.adf.model.connection.url.URLConnectionProxy

All Implemented Interfaces:
javax.naming.Referenceable, URLConnection

public class URLConnectionProxy
extends java.lang.Object
implements URLConnection, javax.naming.Referenceable

URLConnectionProxy represents a proxy to the acutual URLConnection resource. Whenever a client looks up for a URLConnection an instance of this proxy is returned. This proxy contains the reference to actual resource and delegates the call to actual reference on behalf of the caller.

The proxy logically protects the reference to resource being held by the client, once the resource is released. This ensures that the actual reference to the resource cannot be corrupted / used once the resource is released.

Since:
10.1.3

Field Summary

 

Fields inherited from interface oracle.adf.model.connection.url.URLConnection
ATTR_NAME, ATTR_URL

 

Constructor Summary
protected URLConnectionProxy(URLConnection conn)
          Create an instance of this proxy with the actual resource.

 

Method Summary
 void close()
          Close this connection.
 boolean equals(java.lang.Object connection)
          Tests for the equality of another URLConnection instance with the current instance.
 AuthenticationScheme getAuthenticationScheme()
          Get the AuthenticationScheme used by this connection to authenticate against the endpoint
 java.lang.Object getInteraction()
          Start the communication session.
 java.lang.String getName()
          Get the name of this URLConnection.
 Proxy getProxy()
          Get the proxy details for this connection.
 javax.naming.Reference getReference()
          Return the Reference that describes the details of this connection.
 int getTimeout()
          Get the timeout set on this connection.
 java.net.URL getURL()
          Get the URL resource represented by this connection
 void open()
          Open the connection.
 void release()
          Release this connection instance back to the pool.
 void setProxy(Proxy proxy)
          Configure the proxy details for the URL access
 void setTimeout(int timeout)
          Set the timeout property for the connection.
 java.lang.String toString()
          Returns a String representation of this Connection.

 

Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

 

Constructor Detail

URLConnectionProxy

protected URLConnectionProxy(URLConnection conn)
Create an instance of this proxy with the actual resource.
Parameters:
conn - The Actual reference to the URLConnection resource.

Method Detail

getName

public java.lang.String getName()
Get the name of this URLConnection.
Specified by:
getName in interface URLConnection
Returns:
The name of this connection.

open

public void open()
          throws ConnectionException
Open the connection. Prepare the underlying physical communication channel, by doing the necessary authentication and intializations. The physcial connection to the resource is established for the client to start an interaction.
Specified by:
open in interface URLConnection
Throws:
{@link - ConnectionException} if the connection failed to open.
ConnectionException

setProxy

public void setProxy(Proxy proxy)
Configure the proxy details for the URL access
Specified by:
setProxy in interface URLConnection
Parameters:
proxy - The Proxy details needed to access the URL

getProxy

public Proxy getProxy()
Get the proxy details for this connection.
Specified by:
getProxy in interface URLConnection
Returns:
The {#link Proxy} details for this connection, if it exists, null otherwise.

getInteraction

public java.lang.Object getInteraction()
                                throws ConnectionException
Start the communication session. The Interaction represents the actual physical connection to communication channel. The Client must call open() before starting the interaction. This is necessary to initialize and prepare the atual physical channel for communication. The default interaction model for the URLConnection is the HttpClient.HTTPConnection. The HTTPConnection supports the HTTP and HTTPS protocols of communication.
Specified by:
getInteraction in interface URLConnection
Returns:
The HTTPConnection that represents the underlying communication channel.
Throws:
{@link - ConnectionException} if an error occurred in starting the interaction.
ConnectionException

getAuthenticationScheme

public AuthenticationScheme getAuthenticationScheme()
Get the AuthenticationScheme used by this connection to authenticate against the endpoint
Specified by:
getAuthenticationScheme in interface URLConnection
Returns:
The AuthenticationScheme used by this connection. If the connection does not use any authentication null is returned.

getURL

public java.net.URL getURL()
Get the URL resource represented by this connection
Specified by:
getURL in interface URLConnection
Returns:
The URL resource of this connection

setTimeout

public void setTimeout(int timeout)
Set the timeout property for the connection. Clients can set the timeout on the connection before calling the open.
Specified by:
setTimeout in interface URLConnection
Parameters:
timeout - The timeout to be set on the connection instance.

getTimeout

public int getTimeout()
Get the timeout set on this connection. This is the timeout property for the underlying interaction instance.
Specified by:
getTimeout in interface URLConnection
Returns:
The timeout set on the connection. If the connection has been released or the time out property is not valid for certain types of URL Connections then a -1 is returned.

close

public void close()
           throws ConnectionException
Close this connection. Reset the state of the interaction of this connection. Clients can Reopen the connection by calling open() on the connection again. Reopening the connection will reset the state of the interaction associated with this connection.
Specified by:
close in interface URLConnection
Throws:
{@link - ConnectionException} if a failure occured in closing the connection.
ConnectionException

release

public void release()
             throws ConnectionException
Release this connection instance back to the pool. This should be the last operation on a connection instance typically. Once the connection instance is released all operations on the connection reference cease to be valid. The connection reference cannot be reused again within the context of the application. The Client must do a lookup to reuse this connection instance.
Specified by:
release in interface URLConnection
Throws:
{@link - ConnectionException} if the connection could be released to the pool.
ConnectionException

equals

public boolean equals(java.lang.Object connection)
Tests for the equality of another URLConnection instance with the current instance. A URLConnection instance is equal to another instance iff the name with which it is bound in the Connection Manager's JNDI context is the same.
Overrides:
equals in class java.lang.Object
Returns:
true if the connection instances are the same falseotherwise.

getReference

public javax.naming.Reference getReference()
                                    throws javax.naming.NamingException
Return the Reference that describes the details of this connection.
Specified by:
getReference in interface javax.naming.Referenceable
Returns:
The java.naming.Reference instance describing this connection
Throws:
javax.naming.NamingException - if an error was encountered.

toString

public java.lang.String toString()
Returns a String representation of this Connection.
Overrides:
toString in class java.lang.Object
Returns:
The String representation of this URLConnection. This will typically be of the format name:URL

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle ADF Model
11g Release 2 (11.1.2.2.0)

E17483-03


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