//Gets the first matching device that is a PDA
DeliveryContext deliveryContext2 = DeliveryContextFactory.getDeliveryContext(
deliveryContextStore,
"IsPDA");
System.out.println("DeviceUniqueName: " +
deliveryContext2.getAttribute("DeviceUniqueName"));
System.out.println("ImgGIFSupported: " +
deliveryContext2.getAttribute("ImgGIFSupported"));
System.out.println("IsPDA: " + deliveryContext2.getAttribute("IsPDA"));
System.out.println("CharsetSupported: " +
deliveryContext2.getAttribute("UAProf.SoftwarePlatform.CcppAccept-Charset"));
//Gets all devices that are PDAs
DeliveryContext deliveryContexts[] =
DeliveryContextFactory.getDeliveryContexts(
deliveryContextStore,
"IsPDA");
System.out.println("DeviceUniqueName: " +
deliveryContexts[2].getAttribute("DeviceUniqueName"));
System.out.println("ImgGIFSupported: " +
deliveryContexts[2].getAttribute("ImgGIFSupported"));
System.out.println("IsPDA: " + deliveryContexts[2].getAttribute("IsPDA"));
System.out.println("CharsetSupported: " +
deliveryContexts[2].getAttribute("UAProf.SoftwarePlatform.CcppAccept-
Charset"));
}catch(AttributeValueUndefinedException e){
System.out.println(e.getMessage());
}finally{
deliveryContextStore.destroy();
}
}
}
Note: The DeliveryContextStore is responsible for caching and connection pooling and therefore
is expensive to create. It is recommended that this Object be stored and reused for connection to
the database for as long as possible. It is also necessary to call
are finished as it needs to free up database connections. The following JSP example demonstrates
the recommended practice of storing this within the scope of the servlet application.
DeliveryContextStore deliveryContextStore = (DeliveryContextStore)
application.getAttribute("DeliveryContextStore");
if(deliveryContextStore==null) {
deliveryContextStore =
DeliveryContextStoreFactory.getDeliveryContextDBStore(
"jdbc:mysql://cleantest-dev/dbHEAD-G?user=root&password=",
"org.gjt.mm.mysql.Driver");
application.setAttribute("DeliveryContextStore",deliveryContextStore);
}
destroy()
BEA WebLogic Mobility Server User Guide - 195
Part VIII Appendixes
on this object when you
Need help?
Do you have a question about the WebLogic and is the answer not in the manual?