[activemq-activeio] 03/05: Add java9.patch and fix FTBFS with Java 9.

Markus Koschany apo at moszumanska.debian.org
Tue Mar 20 12:49:49 GMT 2018


This is an automated email from the git hooks/post-receive script.

apo pushed a commit to branch master
in repository activemq-activeio.

commit 5b120e364555ba2e4ff58b68e57d6cc7f87b2368
Author: Markus Koschany <apo at debian.org>
Date:   Tue Mar 20 13:37:28 2018 +0100

    Add java9.patch and fix FTBFS with Java 9.
---
 debian/patches/java9.patch | 217 +++++++++++++++++++++++++++++++++++++++++++++
 debian/patches/series      |   1 +
 2 files changed, 218 insertions(+)

diff --git a/debian/patches/java9.patch b/debian/patches/java9.patch
new file mode 100644
index 0000000..99c5c93
--- /dev/null
+++ b/debian/patches/java9.patch
@@ -0,0 +1,217 @@
+From: Markus Koschany <apo at debian.org>
+Date: Tue, 20 Mar 2018 13:37:03 +0100
+Subject: java9
+
+---
+ .../apache/activeio/journal/howl/HowlJournal.java  | 202 ---------------------
+ 1 file changed, 202 deletions(-)
+ delete mode 100644 activeio-core/src/main/java/org/apache/activeio/journal/howl/HowlJournal.java
+
+diff --git a/activeio-core/src/main/java/org/apache/activeio/journal/howl/HowlJournal.java b/activeio-core/src/main/java/org/apache/activeio/journal/howl/HowlJournal.java
+deleted file mode 100644
+index 2f6ebd3..0000000
+--- a/activeio-core/src/main/java/org/apache/activeio/journal/howl/HowlJournal.java
++++ /dev/null
+@@ -1,202 +0,0 @@
+-/**
+- *
+- * Licensed to the Apache Software Foundation (ASF) under one or more
+- * contributor license agreements.  See the NOTICE file distributed with
+- * this work for additional information regarding copyright ownership.
+- * The ASF licenses this file to You 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 org.apache.activeio.journal.howl;
+-
+-import java.io.IOException;
+-import java.io.InterruptedIOException;
+-
+-import org.apache.activeio.journal.InvalidRecordLocationException;
+-import org.apache.activeio.journal.Journal;
+-import org.apache.activeio.journal.JournalEventListener;
+-import org.apache.activeio.journal.RecordLocation;
+-import org.apache.activeio.packet.ByteArrayPacket;
+-import org.apache.activeio.packet.Packet;
+-import org.objectweb.howl.log.Configuration;
+-import org.objectweb.howl.log.InvalidFileSetException;
+-import org.objectweb.howl.log.InvalidLogBufferException;
+-import org.objectweb.howl.log.InvalidLogKeyException;
+-import org.objectweb.howl.log.LogConfigurationException;
+-import org.objectweb.howl.log.LogEventListener;
+-import org.objectweb.howl.log.LogRecord;
+-import org.objectweb.howl.log.Logger;
+-
+-/**
+- * An implementation of the Journal interface using a HOWL logger.  This is is a thin
+- * wrapper around a HOWL logger.
+- * 
+- * This implementation can be used to write records but not to retreive them
+- * yet. Once the HOWL logger implements the methods needed to retreive
+- * previously stored records, this class can be completed.
+- * 
+- * @version $Revision: 1.2 $
+- */
+-public class HowlJournal implements Journal {
+-
+-	private final Logger logger;
+-
+-	private RecordLocation lastMark;
+-
+-	public HowlJournal(Configuration configuration)
+-			throws InvalidFileSetException, LogConfigurationException,
+-			InvalidLogBufferException, ClassNotFoundException, IOException,
+-			InterruptedException {
+-		this.logger = new Logger(configuration);
+-		this.logger.open();
+-		lastMark = new LongRecordLocation(logger.getActiveMark());
+-	}
+-
+-	/**
+-	 * @see org.apache.activeio.journal.Journal#write(byte[], boolean)
+-	 */
+-	public RecordLocation write(Packet packet, boolean sync) throws IOException {
+-		try {
+-			return new LongRecordLocation(logger.put(packet.sliceAsBytes(), sync));
+-		} catch (InterruptedException e) {
+-			throw (InterruptedIOException) new InterruptedIOException()
+-					.initCause(e);
+-		} catch (IOException e) {
+-			throw e;
+-		} catch (Exception e) {
+-			throw (IOException) new IOException("Journal write failed: " + e)
+-					.initCause(e);
+-		}
+-	}
+-
+-	/**
+-	 * @see org.apache.activeio.journal.Journal#setMark(org.codehaus.activemq.journal.RecordLocation, boolean)
+-	 */
+-	public void setMark(RecordLocation recordLocator, boolean force)
+-			throws InvalidRecordLocationException, IOException {
+-		try {
+-			long location = toLong(recordLocator);
+-			logger.mark(location, force);
+-			lastMark = recordLocator;
+-
+-		} catch (InterruptedException e) {
+-			throw (InterruptedIOException) new InterruptedIOException()
+-					.initCause(e);
+-		} catch (IOException e) {
+-			throw e;
+-		} catch (InvalidLogKeyException e) {
+-			throw new InvalidRecordLocationException(e.getMessage(), e);
+-		} catch (Exception e) {
+-			throw (IOException) new IOException("Journal write failed: " + e)
+-					.initCause(e);
+-		}
+-	}
+-	
+-	/**
+-     * @param recordLocator
+-     * @return
+-     * @throws InvalidRecordLocationException
+-     */
+-    private long toLong(RecordLocation recordLocator) throws InvalidRecordLocationException {
+-        if (recordLocator == null
+-        		|| recordLocator.getClass() != LongRecordLocation.class)
+-        	throw new InvalidRecordLocationException();
+-
+-        long location = ((LongRecordLocation) recordLocator)
+-        		.getLongLocation();
+-        return location;
+-    }
+-
+-    /**
+-	 * @see org.apache.activeio.journal.Journal#getMark()
+-	 */
+-	public RecordLocation getMark() {
+-		return lastMark;
+-	}
+-
+-	/**
+-	 * @see org.apache.activeio.journal.Journal#close()
+-	 */
+-	public void close() throws IOException {
+-		try {
+-			logger.close();
+-		} catch (IOException e) {
+-			throw e;
+-		} catch (InterruptedException e) {
+-			throw (InterruptedIOException) new InterruptedIOException()
+-					.initCause(e);
+-		} catch (Exception e) {
+-			throw (IOException) new IOException("Journal close failed: " + e)
+-					.initCause(e);
+-		}
+-	}
+-
+-	/**
+-	 * @see org.apache.activeio.journal.Journal#setJournalEventListener(org.codehaus.activemq.journal.JournalEventListener)
+-	 */
+-	public void setJournalEventListener(final JournalEventListener eventListener) {
+-		logger.setLogEventListener(new LogEventListener() {
+-			public void logOverflowNotification(long key) {
+-				eventListener.overflowNotification(new LongRecordLocation(key));
+-			}
+-		});
+-	}
+-
+-	/**
+-	 * @see org.apache.activeio.journal.Journal#getNextRecordLocation(org.codehaus.activemq.journal.RecordLocation)
+-	 */
+-	public RecordLocation getNextRecordLocation(RecordLocation lastLocation)
+-			throws InvalidRecordLocationException {
+-	    
+-	    if( lastLocation ==null ) {
+-	        if( this.lastMark !=null ) {
+-	            lastLocation = lastMark;
+-	        } else {
+-	            return null;
+-	        }
+-	    }
+-	    
+-	    try {
+-	        while(true) {
+-	            LogRecord record = logger.get(null, toLong(lastLocation));
+-		        // I assume getNext will return null if there is no next record. 
+-	            LogRecord next = logger.getNext(record);
+-	            if( next==null || next.length == 0 )
+-	                return null;
+-	            lastLocation = new LongRecordLocation(next.key);
+-	            if( !next.isCTRL() )
+-	                return lastLocation;
+-	        }
+-		} catch (Exception e) {
+-			throw (InvalidRecordLocationException)new InvalidRecordLocationException().initCause(e);
+-        }
+-		
+-	}
+-
+-	/**
+-	 * @see org.apache.activeio.journal.Journal#read(org.codehaus.activemq.journal.RecordLocation)
+-	 */
+-	public Packet read(RecordLocation location)
+-			throws InvalidRecordLocationException, IOException {
+-	    
+-	    try {
+-            LogRecord record = logger.get(null, toLong(location));
+-            return new ByteArrayPacket(record.data);            
+-		} catch (InvalidLogKeyException e) {
+-			throw new InvalidRecordLocationException(e.getMessage(), e);
+-		} catch (Exception e) {
+-			throw (IOException) new IOException("Journal write failed: " + e)
+-					.initCause(e);
+-		}
+-		
+-	}
+-
+-}
diff --git a/debian/patches/series b/debian/patches/series
index 075ee3b..29df011 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
 exclude_howl_component.diff
 explicit_dependency_on_junit.diff
+java9.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/activemq-activeio.git



More information about the pkg-java-commits mailing list