All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.bitsensor.plugins.shaded.org.springframework.jca.cci.object.EisOperation Maven / Gradle / Ivy

The newest version!
/*
 * Copyright 2002-2012 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package io.bitsensor.plugins.shaded.org.springframework.jca.cci.object;

import javax.resource.cci.ConnectionFactory;
import javax.resource.cci.InteractionSpec;

import io.bitsensor.plugins.shaded.org.springframework.beans.factory.InitializingBean;
import io.bitsensor.plugins.shaded.org.springframework.jca.cci.core.CciTemplate;

/**
 * Base class for EIS operation objects that work with the CCI API.
 * Encapsulates a CCI ConnectionFactory and a CCI InteractionSpec.
 *
 * 

Works with a CciTemplate instance underneath. EIS operation objects * are an alternative to working with a CciTemplate directly. * * @author Juergen Hoeller * @since 1.2 * @see #setConnectionFactory * @see #setInteractionSpec */ public abstract class EisOperation implements InitializingBean { private CciTemplate cciTemplate = new CciTemplate(); private InteractionSpec interactionSpec; /** * Set the CciTemplate to be used by this operation. * Alternatively, specify a CCI ConnectionFactory. * @see #setConnectionFactory */ public void setCciTemplate(CciTemplate cciTemplate) { if (cciTemplate == null) { throw new IllegalArgumentException("cciTemplate must not be null"); } this.cciTemplate = cciTemplate; } /** * Return the CciTemplate used by this operation. */ public CciTemplate getCciTemplate() { return this.cciTemplate; } /** * Set the CCI ConnectionFactory to be used by this operation. */ public void setConnectionFactory(ConnectionFactory connectionFactory) { this.cciTemplate.setConnectionFactory(connectionFactory); } /** * Set the CCI InteractionSpec for this operation. */ public void setInteractionSpec(InteractionSpec interactionSpec) { this.interactionSpec = interactionSpec; } /** * Return the CCI InteractionSpec for this operation. */ public InteractionSpec getInteractionSpec() { return this.interactionSpec; } @Override public void afterPropertiesSet() { this.cciTemplate.afterPropertiesSet(); if (this.interactionSpec == null) { throw new IllegalArgumentException("interactionSpec is required"); } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy