09.12.2012 Views

Advanced Queuing - Oracle

Advanced Queuing - Oracle

Advanced Queuing - Oracle

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

General Features of JMS<br />

After order entry, queue connection factory oe_queue_factory has been<br />

registered in LDAP; it can be looked up as follows:<br />

public static void get_Factory_from_LDAP() throws Exception<br />

{<br />

Hashtable env = new Hashtable(5, 0.75f);<br />

env.put(Context.INITIAL_CONTEXT_FACTORY, AQjmsConstants.INIT_CTX_FACTORY);<br />

}<br />

// aqldapserv is your LDAP host and 389 is your port<br />

env.put(Context.PROVIDER_URL, "ldap://aqldapserv:389);<br />

// now authentication info<br />

// username/password scheme, user is OE, password is OE<br />

env.put(Context.SECURITY_AUTHENTICATION, "simple");<br />

env.put(Context.SECURITY_PRINCIPAL, "cn=oe,cn=users,cn=acme,cn=com");<br />

env.put(Context.SECURITY_CREDENTIALS, "oe");<br />

DirContext inictx = new InitialDirContext(env);<br />

// initialize context with the distinguished name of the database server<br />

inictx=(DirContext)inictx.lookup("cn=db1,cn=<strong>Oracle</strong>Context,cn=acme,cn=com");<br />

//go to the connection factory holder cn=OraclDBConnections<br />

DirContext connctx = (DirContext)inictx.lookup("cn=<strong>Oracle</strong>DBConnections");<br />

// get connection factory "oe_queue_factory"<br />

QueueConnectionFactory qc_fact =<br />

(QueueConnectionFactory)connctx.lookup("cn=oe_queue_factory");<br />

Connection<br />

A JMS Connection is a client’s active connection to its JMS provider. A Connection<br />

performs several critical services:<br />

Encapsulates either an open connection or a pool of connections with a JMS<br />

<br />

provider<br />

Typically represents an open TCP/IP socket (or a set of open sockets) between a<br />

<br />

client and a provider’s service daemon<br />

Provides a structure for authenticating clients at the time of its creation<br />

Creates Sessions<br />

Provides Connection metadata<br />

Supports an optional ExceptionListener<br />

12-8 <strong>Oracle</strong>9i Application Developer’s Guide - <strong>Advanced</strong> <strong>Queuing</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!