*/
public class PersistenceSessionBinding implements Binding {
public Object parse(Element element, Parse parse, Parser parser) {
String factoryName = XmlUtil.attribute(element, "factory");
ReferenceDescriptor factoryDescriptor = new ReferenceDescriptor();
factoryDescriptor.setValue(factoryName);
ObjectDescriptor persistenceSessionDescriptor = new ObjectDescriptor();
persistenceSessionDescriptor.setFactoryDescriptor(factoryDescriptor);
persistenceSessionDescriptor.setMethodName("openPersistenceSession");
persistenceSessionDescriptor.setAutoWireEnabled(true);
String connectionName = XmlUtil.attribute(element, "connection");
if (connectionName!=null) {
List<ArgDescriptor> argDescriptors = new ArrayList<ArgDescriptor>();
persistenceSessionDescriptor.setArgDescriptors(argDescriptors);
ArgDescriptor argDescriptor = new ArgDescriptor();
argDescriptor.setTypeName(Connection.class.getName());
ReferenceDescriptor connectionDescriptor = new ReferenceDescriptor();
connectionDescriptor.setValue(connectionName);
argDescriptor.setDescriptor(connectionDescriptor);
}
SubscribeOperation subscribeOperation = new SubscribeOperation();
subscribeOperation.setWireEvents(false);