@Override public Connection getConnection(ConnectionSpec connectionSpec) throws ResourceException { throw new NotSupportedException( "SingleConnectionFactory does not support custom ConnectionSpec"); }
/** * This implementation always throws a NotSupportedException. */ @Override public void endpointActivation(MessageEndpointFactory messageEndpointFactory, ActivationSpec activationSpec) throws ResourceException { throw new NotSupportedException("SpringContextResourceAdapter does not support message endpoints"); }
@Override public MappedRecord createMappedRecord(String name) throws ResourceException { throw new NotSupportedException("The RecordFactory facility is not supported by the connector"); }
@Override public IndexedRecord createIndexedRecord(String name) throws ResourceException { throw new NotSupportedException("The RecordFactory facility is not supported by the connector"); }
@Override public Connection getConnection(ConnectionSpec connectionSpec) throws ResourceException { throw new NotSupportedException( "SingleConnectionFactory does not support custom ConnectionSpec"); }
/** * This implementation always throws a NotSupportedException. */ @Override public void endpointActivation(MessageEndpointFactory messageEndpointFactory, ActivationSpec activationSpec) throws ResourceException { throw new NotSupportedException("SpringContextResourceAdapter does not support message endpoints"); }
@Override public MappedRecord createMappedRecord(String name) throws ResourceException { throw new NotSupportedException("The RecordFactory facility is not supported by the connector"); }
@Override public IndexedRecord createIndexedRecord(String name) throws ResourceException { throw new NotSupportedException("The RecordFactory facility is not supported by the connector"); }
/** * Set the transaction timeout value for a imported transaction. * * @param timeout transaction timeout value in seconds. Only positive * non-zero values are accepted. Other values are illegal and are * rejected with a <code>NotSupportedException</code>. * * @throws NotSupportedException thrown to indicate an illegal timeout * value. */ public void setTransactionTimeout(long timeout) throws NotSupportedException { if (timeout > 0) { this.transactionTimeout = timeout; } else { throw new NotSupportedException("Illegal timeout value"); } }
public LocalTransaction getLocalTransaction() throws ResourceException { throw new NotSupportedException("LocalTransaction not supported"); }
public XAResource getXAResource() throws ResourceException { throw new NotSupportedException("GetXAResource not supported not supported"); }
@Test public void testTemplateExecuteWithCreatorAndRecordFactoryNotSupported() throws ResourceException { ConnectionFactory connectionFactory = mock(ConnectionFactory.class); Connection connection = mock(Connection.class); Interaction interaction = mock(Interaction.class); Record inputRecord = mock(Record.class); final Record outputRecord = mock(Record.class); InteractionSpec interactionSpec = mock(InteractionSpec.class); given(connectionFactory.getConnection()).willReturn(connection); given(connectionFactory.getRecordFactory()).willThrow(new NotSupportedException("not supported")); given(connection.createInteraction()).willReturn(interaction); given(interaction.execute(interactionSpec, inputRecord, outputRecord)).willReturn(true); CciTemplate ct = new CciTemplate(connectionFactory); ct.setOutputRecordCreator(new RecordCreator() { @Override public Record createRecord(RecordFactory recordFactory) { assertTrue(recordFactory instanceof NotSupportedRecordFactory); return outputRecord; } }); ct.execute(interactionSpec, inputRecord); verify(interaction).execute(interactionSpec, inputRecord, outputRecord); verify(interaction).close(); verify(connection).close(); }
public void setTransactionTimeout(long timeout) throws NotSupportedException { if (timeout<=0) { throw new NotSupportedException("Illegal timeout value"); } this.timeout = timeout; }
public LocalTransaction getLocalTransaction() throws ResourceException { throw new NotSupportedException(); }
public XAResource getXAResource() throws ResourceException { throw new NotSupportedException(); }
public void associateConnection(Object o) throws ResourceException { throw new NotSupportedException(); }
/** * Returns the meta data. */ @Override public ManagedConnectionMetaData getMetaData() throws ResourceException { throw new NotSupportedException(); }
public XAResource[] getXAResources(ActivationSpec[] as) throws ResourceException { throw new NotSupportedException(); }
public LocalTransaction getLocalTransaction() throws ResourceException { throw new NotSupportedException(); } }
/** * {@inheritDoc} */ @Override public LocalTransaction getLocalTransaction() throws ResourceException { throw new NotSupportedException(); }