当前位置: 首页>>代码示例>>Java>>正文


Java NotSupportedException类代码示例

本文整理汇总了Java中javax.resource.NotSupportedException的典型用法代码示例。如果您正苦于以下问题:Java NotSupportedException类的具体用法?Java NotSupportedException怎么用?Java NotSupportedException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


NotSupportedException类属于javax.resource包,在下文中一共展示了NotSupportedException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: endpointActivation

import javax.resource.NotSupportedException; //导入依赖的package包/类
/**
 * This is called during the activation of a message endpoint.
 *
 * @param endpointFactory
 *            A message endpoint factory instance.
 * @param spec
 *            An activation spec JavaBean instance.
 * @throws ResourceException
 *             generic exception
 */
public void endpointActivation(MessageEndpointFactory endpointFactory,
		ActivationSpec spec) throws ResourceException {

	if (!equals(spec.getResourceAdapter())) {
		throw new ResourceException(
				"Activation spec not initialized with this ResourceAdapter instance ("
						+ spec.getResourceAdapter() + " != " + this + ")");
	}

	if (!(spec instanceof RabbitmqActivationSpec)) {
		throw new NotSupportedException(
				"That type of ActivationSpec not supported: "
						+ spec.getClass());
	}

	RabbitmqActivation activation = new RabbitmqActivation(this,
			(RabbitmqActivationSpec) spec, endpointFactory);
	activations.put((RabbitmqActivationSpec) spec, activation);
	activation.start();

	log.tracef("endpointActivation(%s, %s)", endpointFactory, spec);

}
 
开发者ID:leogsilva,项目名称:rabbitmq-resource-adapter,代码行数:34,代码来源:RabbitmqResourceAdapter.java

示例2: build

import javax.resource.NotSupportedException; //导入依赖的package包/类
public QuestionComponent build(Integer questionnaireId, QuestionDTO questionDTO) throws NotSupportedException {
    AbstractQuestionComponent questionComponent = null;
    switch (questionDTO.getType()) {
    case S:
        questionComponent = question.select(ShortFreeTextQuestion.class).get();
        break;
    case F:
        throw new NotSupportedException("Question Type " + questionDTO.getType() + " not supported");
    case L:
        questionComponent = question.select(ListRadioQuestion.class).get();
        break;
    case M:
        questionComponent = question.select(CheckboxListQuestion.class).get();
        break;
    case N:
        questionComponent = question.select(NumericQuestion.class).get();
        break;
    case T:
        throw new NotSupportedException("Question Type " + questionDTO.getType() + " not supported");
    default:
        throw new NotSupportedException("Question Type " + questionDTO.getType() + " not supported");
    }
    questionComponent.setQuestionDTO(questionDTO);
    questionComponent.init();
    return questionComponent;
}
 
开发者ID:antoniomaria,项目名称:gazpachoquest,代码行数:27,代码来源:QuestionFactory.java

示例3: getXAResource

import javax.resource.NotSupportedException; //导入依赖的package包/类
/**
 * Get the XAResource for the connection.
 *
 * @return The XAResource for the connection.
 * @throws ResourceException XA transaction not supported
 */
public XAResource getXAResource() throws ResourceException {
    //
    // Spec says a mc must always return the same XA resource,
    // so we cache it.
    //
    if (!xaTransacted) {
        throw new NotSupportedException("Non XA transaction not supported");
    }

    if (xaResource == null) {
        xaResource = xaSession.getXAResource();
    }

    if (log.isTraceEnabled()) {
        log.trace("XAResource=" + xaResource);
    }

    xaResource = new JmsXAResource(this, xaResource);
    return xaResource;
}
 
开发者ID:vratsel,项目名称:generic-jms-ra,代码行数:27,代码来源:JmsManagedConnection.java

示例4: getXAResource

import javax.resource.NotSupportedException; //导入依赖的package包/类
@Override
public XAResource getXAResource() throws ResourceException {
    if (xaResource == null) {
        throw new NotSupportedException("XAResource not available");
    }
    return new XAResourceProxy();
}
 
开发者ID:ops4j,项目名称:org.ops4j.pax.transx,代码行数:8,代码来源:AbstractManagedConnection.java

示例5: endpointActivation

import javax.resource.NotSupportedException; //导入依赖的package包/类
/**
 * 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");
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:10,代码来源:SpringContextResourceAdapter.java

示例6: getLocalTransaction

import javax.resource.NotSupportedException; //导入依赖的package包/类
public LocalTransaction getLocalTransaction() throws ResourceException {
	// JCA 1.0, section 6.1.10
	// both LocalTransaction and XATransaction resource adapters
	// support local transactions
	// At the same time all transactions will enlist at least Hibernate
	// session and database connection, so support for local transactions
	// is really redundant.
	throw new NotSupportedException("LocalTransaction is not supported!");
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:10,代码来源:ManagedConnectionImpl.java

示例7: testTemplateExecuteWithCreatorAndRecordFactoryNotSupported

import javax.resource.NotSupportedException; //导入依赖的package包/类
@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();
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:32,代码来源:CciTemplateTests.java

示例8: getLocalTransaction

import javax.resource.NotSupportedException; //导入依赖的package包/类
/**
 * Returns an <code>javax.resource.spi.LocalTransaction</code> instance.
 *
 * @return LocalTransaction instance
 * @throws ResourceException generic exception if operation fails
 */
public LocalTransaction getLocalTransaction() throws ResourceException
{
   if (!localTransaction || xaTransaction)
   {
      throw new NotSupportedException("LocalTransaction not supported");
   }
   else
   {
      return lazyLocalTransaction;
   }
}
 
开发者ID:ironjacamar,项目名称:ironjacamar,代码行数:18,代码来源:LazyManagedConnection.java

示例9: getXAResource

import javax.resource.NotSupportedException; //导入依赖的package包/类
/**
 * Returns an <code>javax.transaction.xa.XAresource</code> instance. 
 *
 * @return XAResource instance
 * @throws ResourceException generic exception if operation fails
 */
public XAResource getXAResource() throws ResourceException
{
   if (!xaTransaction || localTransaction)
   {
      throw new NotSupportedException("GetXAResource not supported not supported");
   }
   else
   {
      return lazyXAResource;
   }
}
 
开发者ID:ironjacamar,项目名称:ironjacamar,代码行数:18,代码来源:LazyManagedConnection.java

示例10: setTransactionTimeout

import javax.resource.NotSupportedException; //导入依赖的package包/类
/**
 * 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");
   }
}
 
开发者ID:ironjacamar,项目名称:ironjacamar,代码行数:23,代码来源:ExecutionContext.java

示例11: getXAResources

import javax.resource.NotSupportedException; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public XAResource[] getXAResources()
{
   try
   {
      XAResource[] result = resourceAdapter.getXAResources(new ActivationSpec[] {activationSpec});

      if (result == null || result.length == 0)
         return result;

      XAResource[] newResult = new XAResource[result.length];
      for (int i = 0; i < result.length; i++)
      {
         newResult[i] = new XAResourceWrapperImpl(result[i], productName, productVersion);
      }
      return newResult;
   }
   catch (NotSupportedException nse)
   {
      // Ignore
   }
   catch (ResourceException re)
   {
      log.exceptionDuringCrashRecoveryInflow(resourceAdapter.getClass().getName(), activationSpec, re);
   }

   return new XAResource[0];
}
 
开发者ID:ironjacamar,项目名称:ironjacamar,代码行数:32,代码来源:XAResourceRecoveryInflowImpl.java

示例12: update

import javax.resource.NotSupportedException; //导入依赖的package包/类
public void update(QuestionnairePageDTO page) {
    questionsLayout.removeAllComponents();

    List<SectionDTO> sections = page.getSections();

    for (SectionDTO sectionDTO : sections) {
        if (sectionInfoVisible && page.isSectionInfoAvailable()) {
            final Label sectionTile = new Label(sectionDTO.getLanguageSettings().getTitle());
            sectionTile.addStyleName(Reindeer.LABEL_H2);
            questionsLayout.addComponent(sectionTile);
        }
        List<QuestionDTO> questions = sectionDTO.getQuestions();
        for (QuestionDTO questionDTO : questions) {
            QuestionComponent questionComponent;
            try {
                questionComponent = QuestionFactory.build(questionnaireId, questionDTO);
                questionsLayout.addComponent(questionComponent);
            } catch (NotSupportedException e) {
                logger.warn(e.getMessage());
            }
        }

    }

    HorizontalLayout buttonsLayout = new HorizontalLayout();

    if (page.getMetadata().isNotFirst()) {
        previousButton.addClickListener(this);
        buttonsLayout.addComponent(previousButton);
    }

    if (page.getMetadata().isNotLast()) {
        nextButton.addClickListener(this);
        buttonsLayout.addComponent(nextButton);
    }
    questionsLayout.addComponent(buttonsLayout);
}
 
开发者ID:antoniomaria,项目名称:gazpachoquest,代码行数:38,代码来源:QuestionnaireView.java

示例13: getConnection

import javax.resource.NotSupportedException; //导入依赖的package包/类
public Connection getConnection(ConnectionSpec spec) throws ResourceException {
    if (!(spec instanceof WebDAVConnectionSpec)) {
        throw new NotSupportedException("Need a WebDAVConnectionSpec to create a connection!");
    }
    System.out.println("Getting connection with spec "+spec);
    return (Connection) cm.allocateConnection(mcf, (WebDAVConnectionSpec)spec);
}
 
开发者ID:integrated,项目名称:jakarta-slide-webdavclient,代码行数:8,代码来源:WebDAVConnectionFactory.java

示例14: createMappedRecord

import javax.resource.NotSupportedException; //导入依赖的package包/类
@Override
public MappedRecord createMappedRecord(String name) throws ResourceException {
	throw new NotSupportedException("The RecordFactory facility is not supported by the connector");
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:5,代码来源:NotSupportedRecordFactory.java

示例15: createIndexedRecord

import javax.resource.NotSupportedException; //导入依赖的package包/类
@Override
public IndexedRecord createIndexedRecord(String name) throws ResourceException {
	throw new NotSupportedException("The RecordFactory facility is not supported by the connector");
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:5,代码来源:NotSupportedRecordFactory.java


注:本文中的javax.resource.NotSupportedException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。