The
oracle.soa.management.facade.Locator
interface exposes a method interface as an entry point for Facades API clients.Getting the Locator Information
Hashtable jndiProps = new Hashtable();
jndiProps.put(Context.PROVIDER_URL,
"t3://" + "hostname" + ':' + "portNumber" + "/soa-infra");
jndiProps.put(Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
jndiProps.put(Context.SECURITY_PRINCIPAL, "weblogic");
jndiProps.put(Context.SECURITY_CREDENTIALS, "welcome1");
jndiProps.put("dedicated.connection", "true");
locator = LocatorFactory.createLocator(jndiProps);
Getting the Composite Details
Composite composite = locator.lookupComposite("poc/CompositeName!1.0");
CompositeInstanceFilter filter = new CompositeInstanceFilter();
List <CompositeInstance> obInstances = composite.getInstances(filter);
// for each of the returned composite instances..
for (CompositeInstance instance : obInstances) {
System.out.println(" DN: " + instance.getCompositeDN() +
"Instance: " + instance.getId() +
" creation-date: " +
instance.getCreationDate() + " state (" +
instance.getState() + "): " +
getStateAsString(instance.getState()));
// setup a component filter
ComponentInstanceFilter cInstanceFilter =
new ComponentInstanceFilter();
// get child component instances ..
List <ComponentInstance> childComponentInstances =
instance.getChildComponentInstances(cInstanceFilter);
// for each child component instance (e.g. a bpel process)
for (ComponentInstance cInstance : childComponentInstances) {
System.out.println(" -> componentinstance: " +
cInstance.getComponentName() +
" type: " +
cInstance.getServiceEngine().getEngineType() +
" state: " +
getStateAsString(cInstance.getState()));
}
// retrieve composite sensors
List <SensorData> sensorData = instance.getSensorData();
for (SensorData data : sensorData) {
System.out.println(" -> Sensor: " +
data.getSensor().getName() + " data: " +
data.getData());
}
}
For questions, comments and feedback please contact:
Harvinder Singh Saluja