JBoss hornetq SVN: r12065 - trunk/hornetq-journal/src/main/java/org/hornetq/core/journal/impl.
by do-not-reply@jboss.org
Author: borges
Date: 2012-02-01 11:49:32 -0500 (Wed, 01 Feb 2012)
New Revision: 12065
Modified:
trunk/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/SyncSpeedTest.java
Log:
check return code for error, avoiding Findbugs warning.
Modified: trunk/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/SyncSpeedTest.java
===================================================================
--- trunk/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/SyncSpeedTest.java 2012-02-01 16:49:17 UTC (rev 12064)
+++ trunk/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/SyncSpeedTest.java 2012-02-01 16:49:32 UTC (rev 12065)
@@ -168,7 +168,10 @@
if (file.exists())
{
- file.delete();
+ if (!file.delete())
+ {
+ log.error("failed to delete file " + file);
+ }
}
file.createNewFile();
12 years, 11 months
JBoss hornetq SVN: r12064 - trunk/hornetq-journal/src/main/java/org/hornetq/core/journal/impl.
by do-not-reply@jboss.org
Author: borges
Date: 2012-02-01 11:49:17 -0500 (Wed, 01 Feb 2012)
New Revision: 12064
Modified:
trunk/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/AIOSequentialFileFactory.java
Log:
add .toString()
Modified: trunk/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/AIOSequentialFileFactory.java
===================================================================
--- trunk/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/AIOSequentialFileFactory.java 2012-02-01 16:49:03 UTC (rev 12063)
+++ trunk/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/AIOSequentialFileFactory.java 2012-02-01 16:49:17 UTC (rev 12064)
@@ -349,4 +349,10 @@
}
+ @Override
+ public String toString()
+ {
+ return AIOSequentialFileFactory.class.getSimpleName() + "(buffersControl.stopped=" + buffersControl.stopped +
+ "):" + super.toString();
+ }
}
12 years, 11 months
JBoss hornetq SVN: r12063 - trunk/hornetq-journal/src/main/java/org/hornetq/core/journal/impl.
by do-not-reply@jboss.org
Author: borges
Date: 2012-02-01 11:49:03 -0500 (Wed, 01 Feb 2012)
New Revision: 12063
Modified:
trunk/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/AIOSequentialFile.java
Log:
throw the correct exceptions.
Modified: trunk/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/AIOSequentialFile.java
===================================================================
--- trunk/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/AIOSequentialFile.java 2012-02-01 16:48:48 UTC (rev 12062)
+++ trunk/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/AIOSequentialFile.java 2012-02-01 16:49:03 UTC (rev 12063)
@@ -25,19 +25,16 @@
import org.hornetq.core.journal.IOAsyncTask;
import org.hornetq.core.journal.SequentialFile;
import org.hornetq.core.journal.SequentialFileFactory;
-import org.hornetq.core.logging.Logger;
/**
- *
+ *
* A AIOSequentialFile
- *
+ *
* @author <a href="mailto:clebert.suconic@jboss.com">Clebert Suconic</a>
*
*/
public class AIOSequentialFile extends AbstractSequentialFile implements IOExceptionListener
{
- private static final Logger log = Logger.getLogger(AIOSequentialFile.class);
-
private boolean opened = false;
private final int maxIO;
@@ -237,7 +234,7 @@
public void sync()
{
- throw new IllegalArgumentException("This method is not supported on AIO");
+ throw new UnsupportedOperationException("This method is not supported on AIO");
}
public long size() throws Exception
@@ -268,8 +265,8 @@
{
factory.onIOError(code, message, this);
}
-
+
public void writeDirect(final ByteBuffer bytes, final boolean sync) throws Exception
{
if (sync)
@@ -287,7 +284,7 @@
}
/**
- *
+ *
* @param sync Not used on AIO
* */
public void writeDirect(final ByteBuffer bytes, final boolean sync, final IOAsyncTask callback)
@@ -299,7 +296,7 @@
aioFile.write(positionToWrite, bytesToWrite, bytes, callback);
}
- public void writeInternal(final ByteBuffer bytes) throws Exception
+ public void writeInternal(final ByteBuffer bytes) throws HornetQException
{
final int bytesToWrite = factory.calculateBlockSize(bytes.limit());
@@ -332,5 +329,5 @@
throw new IllegalStateException("File not opened");
}
}
-
+
}
12 years, 11 months
JBoss hornetq SVN: r12062 - trunk/hornetq-core/src/main/java/org/hornetq/core/settings/impl.
by do-not-reply@jboss.org
Author: borges
Date: 2012-02-01 11:48:48 -0500 (Wed, 01 Feb 2012)
New Revision: 12062
Modified:
trunk/hornetq-core/src/main/java/org/hornetq/core/settings/impl/HierarchicalObjectRepository.java
Log:
<T extends String> is non-sense, as String is 'final'.
Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/settings/impl/HierarchicalObjectRepository.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/settings/impl/HierarchicalObjectRepository.java 2012-02-01 16:48:31 UTC (rev 12061)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/settings/impl/HierarchicalObjectRepository.java 2012-02-01 16:48:48 UTC (rev 12062)
@@ -47,7 +47,7 @@
* all the matches
*/
private final Map<String, Match<T>> matches = new HashMap<String, Match<T>>();
-
+
/**
* Certain values cannot be removed after installed.
* This is because we read a few records from the main config.
@@ -60,7 +60,7 @@
/**
* a regex comparator
*/
- private final MatchComparator<String> matchComparator = new MatchComparator<String>();
+ private final MatchComparator matchComparator = new MatchComparator();
/**
* a cache
@@ -72,13 +72,13 @@
*/
private final ArrayList<HierarchicalRepositoryChangeListener> listeners = new ArrayList<HierarchicalRepositoryChangeListener>();
-
+
public void addMatch(final String match, final T value)
{
addMatch(match, value, false);
}
-
+
/**
* Add a new match to the repository
*
@@ -98,7 +98,7 @@
matches.put(match, match1);
onChange();
}
-
+
public int getCacheSize()
{
return cache.size();
@@ -220,12 +220,12 @@
listeners.clear();
matches.clear();
}
-
+
public void clearListeners()
{
listeners.clear();
}
-
+
public void clearCache()
{
cache.clear();
@@ -268,7 +268,7 @@
/**
* compares to matches to see which one is more specific
*/
- private static class MatchComparator<T extends String> implements Comparator<T>
+ private static class MatchComparator implements Comparator<String>
{
public int compare(final String o1, final String o2)
{
12 years, 11 months
JBoss hornetq SVN: r12061 - trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl.
by do-not-reply@jboss.org
Author: borges
Date: 2012-02-01 11:48:31 -0500 (Wed, 01 Feb 2012)
New Revision: 12061
Modified:
trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java
trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/Topology.java
Log:
Fix javadoc warnings.
Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java 2012-02-01 16:48:14 UTC (rev 12060)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java 2012-02-01 16:48:31 UTC (rev 12061)
@@ -1327,9 +1327,6 @@
return connection;
}
- /**
- * @param channel0
- */
public void sendNodeAnnounce(final long currentEventID,
String nodeID,
boolean isBackup,
Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/Topology.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/Topology.java 2012-02-01 16:48:14 UTC (rev 12060)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/Topology.java 2012-02-01 16:48:31 UTC (rev 12061)
@@ -148,9 +148,8 @@
}
/**
- *
- * @param <p>uniqueIdentifier an unique identifier for when the change was made
- * We will use current time millis for starts, and a ++ of that number for shutdown. </p>
+ * @param uniqueEventID an unique identifier for when the change was made We will use current
+ * time millis for starts, and a ++ of that number for shutdown.
* @param nodeId
* @param memberInput
* @return
@@ -207,7 +206,7 @@
if (log.isDebugEnabled())
{
log.debug(this + "::updated currentMember=nodeID=" +
- nodeId +
+ nodeId +
", currentMember=" +
currentMember +
", memberInput=" +
@@ -267,7 +266,7 @@
" connector = " +
memberToSend.getConnector());
}
-
+
try
{
listener.nodeUP(uniqueEventID, nodeId, memberToSend.getConnector(), false);
@@ -545,7 +544,7 @@
{
if (mapDelete == null)
{
- mapDelete = new ConcurrentHashMap<String, Long>();
+ mapDelete = new ConcurrentHashMap<String, Long>();
}
return mapDelete;
}
12 years, 11 months
JBoss hornetq SVN: r12060 - in trunk/hornetq-core/src/main/java/org/hornetq/core: paging/cursor/impl and 1 other directory.
by do-not-reply@jboss.org
Author: borges
Date: 2012-02-01 11:48:14 -0500 (Wed, 01 Feb 2012)
New Revision: 12060
Modified:
trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ServerLocatorImpl.java
trunk/hornetq-core/src/main/java/org/hornetq/core/paging/cursor/impl/PageCursorProviderImpl.java
Log:
Reduce visibility after merge.
Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ServerLocatorImpl.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ServerLocatorImpl.java 2012-02-01 16:37:41 UTC (rev 12059)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ServerLocatorImpl.java 2012-02-01 16:48:14 UTC (rev 12060)
@@ -1238,7 +1238,7 @@
doClose(true);
}
- protected void doClose(final boolean sendClose)
+ private void doClose(final boolean sendClose)
{
if (state == STATE.CLOSED)
{
@@ -1477,7 +1477,7 @@
{
List<DiscoveryEntry> newConnectors = discoveryGroup.getDiscoveryEntries();
-
+
TransportConfiguration[] newInitialconnectors = (TransportConfiguration[])Array.newInstance(TransportConfiguration.class,
newConnectors.size());
@@ -1493,14 +1493,14 @@
topology.updateMember(0, entry.getNodeID(), member);
}
}
-
+
this.initialConnectors = newInitialconnectors;
if (clusterConnection && !receivedTopology && initialConnectors.length > 0)
{
// The node is alone in the cluster. We create a connection to the new node
// to trigger the node notification to form the cluster.
-
+
Runnable connectRunnable = new Runnable()
{
public void run()
@@ -1531,13 +1531,13 @@
synchronized (factories)
{
factories.remove(factory);
-
+
if (!clusterConnection && factories.isEmpty())
{
// Go back to using the broadcast or static list
-
+
receivedTopology = false;
-
+
topologyArray = null;
}
}
@@ -1586,7 +1586,7 @@
}
}
- class StaticConnector implements Serializable
+ private final class StaticConnector implements Serializable
{
private static final long serialVersionUID = 6772279632415242634l;
@@ -1729,7 +1729,8 @@
}
}
- public void finalize() throws Throwable
+ @Override
+ protected void finalize() throws Throwable
{
if (!isClosed() && finalizeCheck)
{
@@ -1749,9 +1750,9 @@
super.finalize();
}
- class Connector
+ private final class Connector
{
- private TransportConfiguration initialConnector;
+ private final TransportConfiguration initialConnector;
private volatile ClientSessionFactoryInternal factory;
@@ -1777,7 +1778,7 @@
if (factoryToUse != null)
{
addToConnecting(factoryToUse);
-
+
try
{
factoryToUse.connect(1, false);
Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/paging/cursor/impl/PageCursorProviderImpl.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/paging/cursor/impl/PageCursorProviderImpl.java 2012-02-01 16:37:41 UTC (rev 12059)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/paging/cursor/impl/PageCursorProviderImpl.java 2012-02-01 16:48:14 UTC (rev 12060)
@@ -36,7 +36,7 @@
/**
* A PageProviderIMpl
- *
+ *
* TODO: this may be moved entirely into PagingStore as there's an one-to-one relationship here
* However I want to keep this isolated as much as possible during development
*
@@ -49,7 +49,7 @@
// Constants -----------------------------------------------------
private static final Logger log = Logger.getLogger(PageCursorProviderImpl.class);
-
+
boolean isTrace = log.isTraceEnabled();
// Attributes ----------------------------------------------------
@@ -350,7 +350,7 @@
{
return;
}
-
+
if (log.isDebugEnabled())
{
log.debug("Asserting cleanup for address " + this.pagingStore.getAddress());
@@ -373,7 +373,7 @@
{
log.debug("Cursor " + cursor + " was considered incomplete at page " + minPage);
}
-
+
complete = false;
break;
}
@@ -399,7 +399,7 @@
log.debug("Address " + pagingStore.getAddress() +
" is leaving page mode as all messages are consumed and acknowledged from the page store");
}
-
+
pagingStore.forceAnotherPage();
Page currentPage = pagingStore.getCurrentPage();
@@ -465,7 +465,7 @@
{
cache = softCache.get((long)depagedPage.getPageId());
}
-
+
if (isTrace)
{
log.trace("Removing page " + depagedPage.getPageId() + " from page-cache");
@@ -477,7 +477,7 @@
// We need to read the page-file before deleting it
// to make sure we remove any large-messages pending
storageManager.beforePageRead();
-
+
List<PagedMessage> pgdMessagesList = null;
try
{
@@ -493,7 +493,7 @@
catch (Exception e)
{
}
-
+
storageManager.afterPageRead();
}
depagedPage.close();
@@ -505,7 +505,7 @@
}
depagedPage.delete(pgdMessages);
-
+
synchronized (softCache)
{
softCache.remove((long)depagedPage.getPageId());
@@ -525,7 +525,7 @@
* @param currentPage
* @throws Exception
*/
- protected void storePositions(ArrayList<PageSubscription> cursorList, Page currentPage) throws Exception
+ private void storePositions(ArrayList<PageSubscription> cursorList, Page currentPage) throws Exception
{
try
{
12 years, 11 months
JBoss hornetq SVN: r12059 - tags.
by do-not-reply@jboss.org
Author: ataylor
Date: 2012-02-01 11:37:41 -0500 (Wed, 01 Feb 2012)
New Revision: 12059
Added:
tags/HornetQ_2_2_11_AS7_Final_Pending/
Log:
pending release for 2.2.11.Final
12 years, 11 months
JBoss hornetq SVN: r12058 - tags.
by do-not-reply@jboss.org
Author: ataylor
Date: 2012-02-01 11:37:08 -0500 (Wed, 01 Feb 2012)
New Revision: 12058
Removed:
tags/HornetQ_2_2_11_AS7_Final_Pending/
Log:
deleted pending release for 2.2.11.Final
12 years, 11 months
JBoss hornetq SVN: r12057 - in branches/Branch_2_2_AS7/src/main/org/hornetq: service and 1 other directory.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2012-02-01 11:07:27 -0500 (Wed, 01 Feb 2012)
New Revision: 12057
Removed:
branches/Branch_2_2_AS7/src/main/org/hornetq/integration/jboss/security/AS4SecurityActions.java
Modified:
branches/Branch_2_2_AS7/src/main/org/hornetq/integration/jboss/security/JBossASSecurityManager.java
branches/Branch_2_2_AS7/src/main/org/hornetq/service/JBossASSecurityManagerService.java
Log:
Removing AS4 dependency
Deleted: branches/Branch_2_2_AS7/src/main/org/hornetq/integration/jboss/security/AS4SecurityActions.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/integration/jboss/security/AS4SecurityActions.java 2012-02-01 15:19:08 UTC (rev 12056)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/integration/jboss/security/AS4SecurityActions.java 2012-02-01 16:07:27 UTC (rev 12057)
@@ -1,126 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat 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.hornetq.integration.jboss.security;
-
-import java.security.AccessController;
-import java.security.Principal;
-import java.security.PrivilegedAction;
-
-import javax.security.auth.Subject;
-
-import org.jboss.security.SecurityAssociation;
-
-/** A collection of privileged actions for this package
- * @author Scott.Stark(a)jboss.org
- * @author <a href="mailto:alex@jboss.org">Alexey Loubyansky</a>
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- * @author <a href="mailto:anil.saldhana@jboss.com">anil saldhana</a>
- * @version $Revison: 1.0$
- */
-
-/**
- * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
- * Created Oct 21, 2009
- */
-public class AS4SecurityActions
-{
- interface PrincipalInfoAction
- {
- PrincipalInfoAction PRIVILEGED = new PrincipalInfoAction()
- {
- public void push(final Principal principal, final Object credential, final Subject subject)
- {
- AccessController.doPrivileged(new PrivilegedAction()
- {
- public Object run()
- {
- SecurityAssociation.pushSubjectContext(subject, principal, credential);
- return null;
- }
- });
- }
-
- public void dup()
- {
- AccessController.doPrivileged(new PrivilegedAction()
- {
- public Object run()
- {
- SecurityAssociation.dupSubjectContext();
- return null;
- }
- });
- }
-
- public void pop()
- {
- AccessController.doPrivileged(new PrivilegedAction()
- {
- public Object run()
- {
- SecurityAssociation.popSubjectContext();
- return null;
- }
- });
- }
- };
-
- PrincipalInfoAction NON_PRIVILEGED = new PrincipalInfoAction()
- {
- public void push(final Principal principal, final Object credential, final Subject subject)
- {
- SecurityAssociation.pushSubjectContext(subject, principal, credential);
- }
-
- public void dup()
- {
- SecurityAssociation.dupSubjectContext();
- }
-
- public void pop()
- {
- SecurityAssociation.popSubjectContext();
- }
- };
-
- void push(Principal principal, Object credential, Subject subject);
-
- void dup();
-
- void pop();
- }
-
- static void pushSubjectContext(final Principal principal, final Object credential, final Subject subject)
- {
- if (System.getSecurityManager() == null)
- {
- PrincipalInfoAction.NON_PRIVILEGED.push(principal, credential, subject);
- }
- else
- {
- PrincipalInfoAction.PRIVILEGED.push(principal, credential, subject);
- }
- }
-
- static void popSubjectContext()
- {
- if (System.getSecurityManager() == null)
- {
- PrincipalInfoAction.NON_PRIVILEGED.pop();
- }
- else
- {
- PrincipalInfoAction.PRIVILEGED.pop();
- }
- }
-}
Modified: branches/Branch_2_2_AS7/src/main/org/hornetq/integration/jboss/security/JBossASSecurityManager.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/integration/jboss/security/JBossASSecurityManager.java 2012-02-01 15:19:08 UTC (rev 12056)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/integration/jboss/security/JBossASSecurityManager.java 2012-02-01 16:07:27 UTC (rev 12057)
@@ -63,8 +63,6 @@
private boolean started;
- private boolean isAs5 = true;
-
private boolean allowClientLogin = false;
private boolean authoriseOnClientLogin = false;
@@ -183,26 +181,12 @@
private void popSecurityContext()
{
- if (isAs5)
- {
- SecurityActions.popSubjectContext();
- }
- else
- {
- AS4SecurityActions.popSubjectContext();
- }
+ SecurityActions.popSubjectContext();
}
private void pushSecurityContext(final SimplePrincipal principal, final char[] passwordChars, final Subject subject)
{
- if (isAs5)
- {
- SecurityActions.pushSubjectContext(principal, passwordChars, subject, securityDomainName);
- }
- else
- {
- AS4SecurityActions.pushSubjectContext(principal, passwordChars, subject);
- }
+ SecurityActions.pushSubjectContext(principal, passwordChars, subject, securityDomainName);
}
public void addRole(final String user, final String role)
@@ -291,11 +275,6 @@
this.securityDomainName = securityDomainName;
}
- public void setAs5(final boolean as5)
- {
- isAs5 = as5;
- }
-
public void setAllowClientLogin(final boolean allowClientLogin)
{
this.allowClientLogin = allowClientLogin;
Modified: branches/Branch_2_2_AS7/src/main/org/hornetq/service/JBossASSecurityManagerService.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/service/JBossASSecurityManagerService.java 2012-02-01 15:19:08 UTC (rev 12056)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/service/JBossASSecurityManagerService.java 2012-02-01 16:07:27 UTC (rev 12057)
@@ -25,7 +25,6 @@
public void create()
{
jBossASSecurityManager = new JBossASSecurityManager();
- jBossASSecurityManager.setAs5(false);
}
public JBossASSecurityManager getJBossASSecurityManager()
12 years, 11 months
JBoss hornetq SVN: r12056 - branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/unit/ra.
by do-not-reply@jboss.org
Author: ataylor
Date: 2012-02-01 10:19:08 -0500 (Wed, 01 Feb 2012)
New Revision: 12056
Modified:
branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/unit/ra/HornetQResourceAdapterConfigTest.java
Log:
test fix
Modified: branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/unit/ra/HornetQResourceAdapterConfigTest.java
===================================================================
--- branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/unit/ra/HornetQResourceAdapterConfigTest.java 2012-02-01 09:02:24 UTC (rev 12055)
+++ branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/unit/ra/HornetQResourceAdapterConfigTest.java 2012-02-01 15:19:08 UTC (rev 12056)
@@ -307,7 +307,7 @@
Map<String,Method> methodList = new HashMap<String, Method>();
for (Method method : methods)
{
- if(method.getName().startsWith("set"))
+ if(method.getName().startsWith("set") && !method.getName().equals("setManagedConnectionFactory"))
{
methodList.put(method.getName(), method);
}
12 years, 11 months