public int getNumOfSupportedCFs () { return outboundRA.getConnectionDefs().size(); }
public int getNumOfSupportedCFs () { if (outboundRA == null) { return 0; } return outboundRA.getConnectionDefs().size(); }
public ConnectionDefDescriptor getConnectionDefinitionByCFType (String type, boolean useDefault) { Iterator it = this.outboundRA.getConnectionDefs().iterator(); while (it.hasNext()) { ConnectionDefDescriptor desc = (ConnectionDefDescriptor) it.next(); if (type == null) { if (useDefault && this.outboundRA.getConnectionDefs().size() == 1) return desc; else return null; } if (desc.getConnectionFactoryIntf().equals(type)) return desc; } return null; }
public ConnectionDefDescriptor getConnectionDefinitionByCFType (String type, boolean useDefault) { if (this.outboundRA == null) { return null; } Iterator it = this.outboundRA.getConnectionDefs().iterator(); while (it.hasNext()) { ConnectionDefDescriptor desc = (ConnectionDefDescriptor) it.next(); if (type == null) { if (useDefault && this.outboundRA.getConnectionDefs().size() == 1) return desc; else return null; } if (desc.getConnectionFactoryIntf().equals(type)) return desc; } return null; }
/** * Obtain all the ConnectionDefDescriptor(abstracts the * <connector-definition> element in ra.xml) objects that are * present in given ra.xml file. * * @param connectorDesc ConnectorDescriptor object which * represents the ra.xml and sun-ra.xml * @return Array of ConnectionDefDescriptor objects which represent the * <connection-definition> element. */ public static ConnectionDefDescriptor[] getConnectionDefs(ConnectorDescriptor connectorDesc) { ConnectionDefDescriptor[] connectionDefDescs = new ConnectionDefDescriptor[0]; OutboundResourceAdapter ora = connectorDesc.getOutboundResourceAdapter(); if (ora != null) { Set connectionDefs = ora.getConnectionDefs(); Iterator iter = connectionDefs.iterator(); int size = connectionDefs.size(); connectionDefDescs = new ConnectionDefDescriptor[size]; for (int i = 0; i < size; ++i) { connectionDefDescs[i] = (ConnectionDefDescriptor) iter.next(); } } return connectionDefDescs; }
/** * {@inheritDoc} */ public boolean handles(ConnectorDescriptor cd, String moduleName) { boolean canHandle = false; boolean adminObjectsDefined = false; Set adminObjects = cd.getAdminObjects(); if (adminObjects != null && adminObjects.size() > 0) { adminObjectsDefined = true; } /* this class can handle Connector 1.0 Spec. compliant RAR criteria for 1.0 RAR : * No inbound artifacts * No admin-objects * There should be only one connection-definition * RA Class should not be present (equivalent to "") */ if(!cd.getInBoundDefined() && !adminObjectsDefined && (cd.getOutBoundDefined() && cd.getOutboundResourceAdapter().getConnectionDefs().size() < 2 && "".equals(cd.getResourceAdapterClass())) ){ canHandle = true; } return canHandle; }
/** * {@inheritDoc} */ public boolean handles(ConnectorDescriptor cd, String moduleName) { boolean adminObjectsDefined = false; Set adminObjects = cd.getAdminObjects(); if (adminObjects != null && adminObjects.size() > 0) { adminObjectsDefined = true; } /* this class can handle Connector 1.5 Spec. compliant RAR that has no inbound artifacts criteria for 1.5 RAR : * No inbound artifacts * Any one of the following conditions hold true : * -> admin object is defined or * -> resource-adapter-class is defined or * -> more than one connection-definition is defined. */ boolean canHandle = false; if(!cd.getInBoundDefined()){ if(cd.getOutBoundDefined() && cd.getOutboundResourceAdapter().getConnectionDefs().size() > 1){ canHandle = true; }else if (adminObjectsDefined){ canHandle = true; }else if(!cd.getResourceAdapterClass().equals("")){ canHandle = true; } } return canHandle; }
for (Iterator i = this.outboundRA.getConnectionDefs().iterator(); i.hasNext();)
if(ora == null || ora.getConnectionDefs().size() == 0) { return null; Set connectionDefs = ora.getConnectionDefs(); if(connectionDefs== null || connectionDefs.size() == 0) { return null;
for (Iterator i = this.outboundRA.getConnectionDefs().iterator(); i.hasNext();)
connectionDefs = ((OutboundResourceAdapter)desc).getConnectionDefs().iterator();
Set connectionDefinitions = descriptor.getOutboundResourceAdapter().getConnectionDefs(); if(connectionDefinitions.size() == 0){ throw new RuntimeException("Invalid connector descriptor for RAR [ "+descriptor.getName()+" ], when " +
connectionDefs = ((OutboundResourceAdapter)desc).getConnectionDefs().iterator();
Set connectionDefs = ora.getConnectionDefs(); Iterator it = connectionDefs.iterator(); while (it.hasNext()) {
connectorDescriptor.getOutboundResourceAdapter().getConnectionDefs();
Set connectionDefinitions = ora.getConnectionDefs();
connectorDescriptor.getOutboundResourceAdapter().getConnectionDefs(); ConnectionDefDescriptor cdd = null; Iterator it = connectionDefs.iterator();
connectorDescriptor.getOutboundResourceAdapter().getConnectionDefs(); ConnectionDefDescriptor cdd = null; Iterator it = connectionDefs.iterator();