001/*
002 * Licensed to DuraSpace under one or more contributor license agreements.
003 * See the NOTICE file distributed with this work for additional information
004 * regarding copyright ownership.
005 *
006 * DuraSpace licenses this file to you under the Apache License,
007 * Version 2.0 (the "License"); you may not use this file except in
008 * compliance with the License.  You may obtain a copy of the License at
009 *
010 *     http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing, software
013 * distributed under the License is distributed on an "AS IS" BASIS,
014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015 * See the License for the specific language governing permissions and
016 * limitations under the License.
017 */
018package org.fcrepo.jms;
019
020import javax.jms.JMSException;
021import javax.jms.Message;
022
023import org.fcrepo.kernel.api.observer.Event;
024
025/**
026 * Produce a JMS Message from a JCR Event
027 *
028 * @author awoods
029 */
030public interface JMSEventMessageFactory {
031
032    /**
033     * Produce a JMS message from a JCR event with the
034     * given session
035     *
036     * @param jcrEvent the jcr event
037     * @param jmsSession the jms session
038     * @return JMS message created from a JCR event
039     * @throws JMSException if JMS exception occurred
040     */
041    Message getMessage(final Event jcrEvent,
042            final javax.jms.Session jmsSession) throws JMSException;
043}