/** * 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; }
/** * write the descriptor class to a DOM tree and return it * * @param parent node for the DOM tree * @param the descriptor to write * @return the DOM tree top node */ public Node writeDescriptor(Node connectorNode, Descriptor descriptor) { //outbound RA info Node raNode = appendChild(connectorNode, ConnectorTagNames.OUTBOUND_RESOURCE_ADAPTER); append(raNode, (OutboundResourceAdapter)((ConnectorDescriptor)descriptor).getOutboundResourceAdapter()); return connectorNode; }
/** * write the descriptor class to a DOM tree and return it * * @param parent node for the DOM tree * @param the descriptor to write * @return the DOM tree top node */ public Node writeDescriptor(Node connectorNode, Descriptor descriptor) { //outbound RA info Node raNode = appendChild(connectorNode, ConnectorTagNames.OUTBOUND_RESOURCE_ADAPTER); append(raNode, (OutboundResourceAdapter)((ConnectorDescriptor)descriptor).getOutboundResourceAdapter()); return connectorNode; }
public static OutboundResourceAdapter getOutbound(ConnectorDescriptor desc) { if (!desc.getOutBoundDefined()) { desc.setOutboundResourceAdapter(new OutboundResourceAdapter()); } return desc.getOutboundResourceAdapter(); }
private ConnectorDescriptorInfo createConnectorDescriptorInfo( ConnectorDescriptor connDesc, String moduleName) { ConnectorDescriptorInfo connDescInfo = new ConnectorDescriptorInfo(); connDescInfo.setManagedConnectionFactoryClass( connDesc.getOutboundResourceAdapter(). getManagedConnectionFactoryImpl()); connDescInfo.setRarName(moduleName); connDescInfo.setResourceAdapterClassName(connDesc. getResourceAdapterClass()); connDescInfo.setConnectionDefinitionName( connDesc.getOutboundResourceAdapter().getConnectionFactoryIntf()); connDescInfo.setConnectionFactoryClass( connDesc.getOutboundResourceAdapter().getConnectionFactoryImpl()); connDescInfo.setConnectionFactoryInterface( connDesc.getOutboundResourceAdapter().getConnectionFactoryIntf()); connDescInfo.setConnectionClass( connDesc.getOutboundResourceAdapter().getConnectionImpl()); connDescInfo.setConnectionInterface( connDesc.getOutboundResourceAdapter().getConnectionIntf()); return connDescInfo; }
/** * Obtain the authentication service associated with rar module. * Currently only the BasicPassword authentication is supported. * * @param rarName Rar module Name * @param poolInfo Name of the pool. Used for creation of * BasicPasswordAuthenticationService * @return AuthenticationService */ public AuthenticationService getAuthenticationService(String rarName, PoolInfo poolInfo) { ConnectorDescriptor cd = _registry.getDescriptor(rarName); OutboundResourceAdapter obra = cd.getOutboundResourceAdapter(); Set authMechs = obra.getAuthMechanisms(); for (Object authMech : authMechs) { AuthMechanism authMechanism = (AuthMechanism) authMech; String mech = authMechanism.getAuthMechType(); if (mech.equals("BasicPassword")) { return new BasicPasswordAuthenticationService(rarName, poolInfo); } } return null; } }
/** * {@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; }
public static int getTransactionSupportFromRaXml(String rarName) throws ConnectorRuntimeException { String txSupport = ConnectorRuntime.getRuntime().getConnectorDescriptor(rarName). getOutboundResourceAdapter().getTransSupport(); return parseTransactionSupportString(txSupport); } }
/** * {@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; }
/** * provides the transaction support for the pool. * If none specified in the pool, tx support at RA level will be returned. * @param pool connector connection pool * @return tx support level */ private String getTransactionSupport(ConnectorConnectionPool pool) { String txSupport = pool.getTransactionSupport(); if (txSupport != null) { return txSupport; } try { txSupport = ConnectorRuntime.getRuntime().getConnectorDescriptor( pool.getResourceAdapterName()).getOutboundResourceAdapter(). getTransSupport(); } catch (ConnectorRuntimeException cre) { Object params[] = new Object[]{pool.getResourceAdapterName(), cre}; _logger.log(Level.WARNING, "error.retrieving.tx-support.from.rar", params); if(_logger.isLoggable(Level.FINEST)) { _logger.finest("setting no-tx-support as tx-support-level for pool : " + pool.getName()); } txSupport = ConnectorConstants.NO_TRANSACTION_TX_SUPPORT_STRING; } return txSupport; }
desc.getOutboundResourceAdapter(); if(ora == null || ora.getConnectionDefs().size() == 0) { return null;
Set connectionDefinitions = descriptor.getOutboundResourceAdapter().getConnectionDefs(); if(connectionDefinitions.size() == 0){ throw new RuntimeException("Invalid connector descriptor for RAR [ "+descriptor.getName()+" ], when " +
OutboundResourceAdapter ora = desc.getOutboundResourceAdapter(); Set connectionDefs = ora.getConnectionDefs(); Iterator it = connectionDefs.iterator();
OutboundResourceAdapter ora = desc.getOutboundResourceAdapter();
connectorDescriptor.getOutboundResourceAdapter().getConnectionDefs();
if (desc.getOutBoundDefined()) { OutboundResourceAdapter ora = desc.getOutboundResourceAdapter(); Set connectionDefinitions = ora.getConnectionDefs();
Set connDefDescSet = connDesc.getOutboundResourceAdapter(). getConnectionDefs();
connectorDescriptor.getOutboundResourceAdapter().getConnectionDefs(); ConnectionDefDescriptor cdd = null; Iterator it = connectionDefs.iterator();
connectorDescriptor.getOutboundResourceAdapter().getConnectionDefs(); ConnectionDefDescriptor cdd = null; Iterator it = connectionDefs.iterator();
desc.setOutboundResourceAdapter(ora); OutboundResourceAdapter ora = desc.getOutboundResourceAdapter(); String[] description = authMechanism.description(); int authMechanismValue = getAuthMechVal(authMechanism.authMechanism());