mirror of https://github.com/apache/activemq.git
fixing deprecated methods usage and other compiling warnings
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@800776 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
538d07e5bb
commit
0479a4eddb
|
@ -21,6 +21,8 @@ import java.security.SecureRandom;
|
|||
import javax.jms.JMSException;
|
||||
import javax.net.ssl.KeyManager;
|
||||
import javax.net.ssl.TrustManager;
|
||||
|
||||
import org.apache.activemq.broker.SslContext;
|
||||
import org.apache.activemq.transport.Transport;
|
||||
import org.apache.activemq.transport.tcp.SslTransportFactory;
|
||||
import org.apache.activemq.util.JMSExceptionSupport;
|
||||
|
@ -69,7 +71,8 @@ public class ActiveMQSslConnectionFactory extends ActiveMQConnectionFactory {
|
|||
|
||||
try {
|
||||
SslTransportFactory sslFactory = new SslTransportFactory();
|
||||
sslFactory.setKeyAndTrustManagers(keyManager, trustManager, secureRandom);
|
||||
SslContext ctx = new SslContext(keyManager, trustManager, secureRandom);
|
||||
SslContext.setCurrentSslContext(ctx);
|
||||
return sslFactory.doConnect(brokerURL);
|
||||
} catch (Exception e) {
|
||||
throw JMSExceptionSupport.create("Could not create Transport. Reason: " + e, e);
|
||||
|
|
|
@ -68,7 +68,7 @@ public class RemoveSubscriptionInfoMarshaller extends BaseCommandMarshaller {
|
|||
|
||||
RemoveSubscriptionInfo info = (RemoveSubscriptionInfo)o;
|
||||
info.setConnectionId((org.apache.activemq.command.ConnectionId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
|
||||
info.setSubcriptionName(tightUnmarshalString(dataIn, bs));
|
||||
info.setSubscriptionName(tightUnmarshalString(dataIn, bs));
|
||||
info.setClientId(tightUnmarshalString(dataIn, bs));
|
||||
|
||||
}
|
||||
|
@ -83,7 +83,7 @@ public class RemoveSubscriptionInfoMarshaller extends BaseCommandMarshaller {
|
|||
|
||||
int rc = super.tightMarshal1(wireFormat, o, bs);
|
||||
rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getConnectionId(), bs);
|
||||
rc += tightMarshalString1(info.getSubcriptionName(), bs);
|
||||
rc += tightMarshalString1(info.getSubscriptionName(), bs);
|
||||
rc += tightMarshalString1(info.getClientId(), bs);
|
||||
|
||||
return rc + 0;
|
||||
|
@ -101,7 +101,7 @@ public class RemoveSubscriptionInfoMarshaller extends BaseCommandMarshaller {
|
|||
|
||||
RemoveSubscriptionInfo info = (RemoveSubscriptionInfo)o;
|
||||
tightMarshalCachedObject2(wireFormat, (DataStructure)info.getConnectionId(), dataOut, bs);
|
||||
tightMarshalString2(info.getSubcriptionName(), dataOut, bs);
|
||||
tightMarshalString2(info.getSubscriptionName(), dataOut, bs);
|
||||
tightMarshalString2(info.getClientId(), dataOut, bs);
|
||||
|
||||
}
|
||||
|
@ -118,7 +118,7 @@ public class RemoveSubscriptionInfoMarshaller extends BaseCommandMarshaller {
|
|||
|
||||
RemoveSubscriptionInfo info = (RemoveSubscriptionInfo)o;
|
||||
info.setConnectionId((org.apache.activemq.command.ConnectionId) looseUnmarsalCachedObject(wireFormat, dataIn));
|
||||
info.setSubcriptionName(looseUnmarshalString(dataIn));
|
||||
info.setSubscriptionName(looseUnmarshalString(dataIn));
|
||||
info.setClientId(looseUnmarshalString(dataIn));
|
||||
|
||||
}
|
||||
|
@ -133,7 +133,7 @@ public class RemoveSubscriptionInfoMarshaller extends BaseCommandMarshaller {
|
|||
|
||||
super.looseMarshal(wireFormat, o, dataOut);
|
||||
looseMarshalCachedObject(wireFormat, (DataStructure)info.getConnectionId(), dataOut);
|
||||
looseMarshalString(info.getSubcriptionName(), dataOut);
|
||||
looseMarshalString(info.getSubscriptionName(), dataOut);
|
||||
looseMarshalString(info.getClientId(), dataOut);
|
||||
|
||||
}
|
||||
|
|
|
@ -70,7 +70,7 @@ public class SubscriptionInfoMarshaller extends BaseDataStreamMarshaller {
|
|||
info.setClientId(tightUnmarshalString(dataIn, bs));
|
||||
info.setDestination((org.apache.activemq.command.ActiveMQDestination) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
|
||||
info.setSelector(tightUnmarshalString(dataIn, bs));
|
||||
info.setSubcriptionName(tightUnmarshalString(dataIn, bs));
|
||||
info.setSubscriptionName(tightUnmarshalString(dataIn, bs));
|
||||
|
||||
}
|
||||
|
||||
|
@ -86,7 +86,7 @@ public class SubscriptionInfoMarshaller extends BaseDataStreamMarshaller {
|
|||
rc += tightMarshalString1(info.getClientId(), bs);
|
||||
rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getDestination(), bs);
|
||||
rc += tightMarshalString1(info.getSelector(), bs);
|
||||
rc += tightMarshalString1(info.getSubcriptionName(), bs);
|
||||
rc += tightMarshalString1(info.getSubscriptionName(), bs);
|
||||
|
||||
return rc + 0;
|
||||
}
|
||||
|
@ -105,7 +105,7 @@ public class SubscriptionInfoMarshaller extends BaseDataStreamMarshaller {
|
|||
tightMarshalString2(info.getClientId(), dataOut, bs);
|
||||
tightMarshalCachedObject2(wireFormat, (DataStructure)info.getDestination(), dataOut, bs);
|
||||
tightMarshalString2(info.getSelector(), dataOut, bs);
|
||||
tightMarshalString2(info.getSubcriptionName(), dataOut, bs);
|
||||
tightMarshalString2(info.getSubscriptionName(), dataOut, bs);
|
||||
|
||||
}
|
||||
|
||||
|
@ -123,7 +123,7 @@ public class SubscriptionInfoMarshaller extends BaseDataStreamMarshaller {
|
|||
info.setClientId(looseUnmarshalString(dataIn));
|
||||
info.setDestination((org.apache.activemq.command.ActiveMQDestination) looseUnmarsalCachedObject(wireFormat, dataIn));
|
||||
info.setSelector(looseUnmarshalString(dataIn));
|
||||
info.setSubcriptionName(looseUnmarshalString(dataIn));
|
||||
info.setSubscriptionName(looseUnmarshalString(dataIn));
|
||||
|
||||
}
|
||||
|
||||
|
@ -139,7 +139,7 @@ public class SubscriptionInfoMarshaller extends BaseDataStreamMarshaller {
|
|||
looseMarshalString(info.getClientId(), dataOut);
|
||||
looseMarshalCachedObject(wireFormat, (DataStructure)info.getDestination(), dataOut);
|
||||
looseMarshalString(info.getSelector(), dataOut);
|
||||
looseMarshalString(info.getSubcriptionName(), dataOut);
|
||||
looseMarshalString(info.getSubscriptionName(), dataOut);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -68,7 +68,7 @@ public class RemoveSubscriptionInfoMarshaller extends BaseCommandMarshaller {
|
|||
|
||||
RemoveSubscriptionInfo info = (RemoveSubscriptionInfo)o;
|
||||
info.setConnectionId((org.apache.activemq.command.ConnectionId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
|
||||
info.setSubcriptionName(tightUnmarshalString(dataIn, bs));
|
||||
info.setSubscriptionName(tightUnmarshalString(dataIn, bs));
|
||||
info.setClientId(tightUnmarshalString(dataIn, bs));
|
||||
|
||||
}
|
||||
|
@ -83,7 +83,7 @@ public class RemoveSubscriptionInfoMarshaller extends BaseCommandMarshaller {
|
|||
|
||||
int rc = super.tightMarshal1(wireFormat, o, bs);
|
||||
rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getConnectionId(), bs);
|
||||
rc += tightMarshalString1(info.getSubcriptionName(), bs);
|
||||
rc += tightMarshalString1(info.getSubscriptionName(), bs);
|
||||
rc += tightMarshalString1(info.getClientId(), bs);
|
||||
|
||||
return rc + 0;
|
||||
|
@ -101,7 +101,7 @@ public class RemoveSubscriptionInfoMarshaller extends BaseCommandMarshaller {
|
|||
|
||||
RemoveSubscriptionInfo info = (RemoveSubscriptionInfo)o;
|
||||
tightMarshalCachedObject2(wireFormat, (DataStructure)info.getConnectionId(), dataOut, bs);
|
||||
tightMarshalString2(info.getSubcriptionName(), dataOut, bs);
|
||||
tightMarshalString2(info.getSubscriptionName(), dataOut, bs);
|
||||
tightMarshalString2(info.getClientId(), dataOut, bs);
|
||||
|
||||
}
|
||||
|
@ -118,7 +118,7 @@ public class RemoveSubscriptionInfoMarshaller extends BaseCommandMarshaller {
|
|||
|
||||
RemoveSubscriptionInfo info = (RemoveSubscriptionInfo)o;
|
||||
info.setConnectionId((org.apache.activemq.command.ConnectionId) looseUnmarsalCachedObject(wireFormat, dataIn));
|
||||
info.setSubcriptionName(looseUnmarshalString(dataIn));
|
||||
info.setSubscriptionName(looseUnmarshalString(dataIn));
|
||||
info.setClientId(looseUnmarshalString(dataIn));
|
||||
|
||||
}
|
||||
|
@ -133,7 +133,7 @@ public class RemoveSubscriptionInfoMarshaller extends BaseCommandMarshaller {
|
|||
|
||||
super.looseMarshal(wireFormat, o, dataOut);
|
||||
looseMarshalCachedObject(wireFormat, (DataStructure)info.getConnectionId(), dataOut);
|
||||
looseMarshalString(info.getSubcriptionName(), dataOut);
|
||||
looseMarshalString(info.getSubscriptionName(), dataOut);
|
||||
looseMarshalString(info.getClientId(), dataOut);
|
||||
|
||||
}
|
||||
|
|
|
@ -70,7 +70,7 @@ public class SubscriptionInfoMarshaller extends BaseDataStreamMarshaller {
|
|||
info.setClientId(tightUnmarshalString(dataIn, bs));
|
||||
info.setDestination((org.apache.activemq.command.ActiveMQDestination) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
|
||||
info.setSelector(tightUnmarshalString(dataIn, bs));
|
||||
info.setSubcriptionName(tightUnmarshalString(dataIn, bs));
|
||||
info.setSubscriptionName(tightUnmarshalString(dataIn, bs));
|
||||
|
||||
}
|
||||
|
||||
|
@ -86,7 +86,7 @@ public class SubscriptionInfoMarshaller extends BaseDataStreamMarshaller {
|
|||
rc += tightMarshalString1(info.getClientId(), bs);
|
||||
rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getDestination(), bs);
|
||||
rc += tightMarshalString1(info.getSelector(), bs);
|
||||
rc += tightMarshalString1(info.getSubcriptionName(), bs);
|
||||
rc += tightMarshalString1(info.getSubscriptionName(), bs);
|
||||
|
||||
return rc + 0;
|
||||
}
|
||||
|
@ -105,7 +105,7 @@ public class SubscriptionInfoMarshaller extends BaseDataStreamMarshaller {
|
|||
tightMarshalString2(info.getClientId(), dataOut, bs);
|
||||
tightMarshalCachedObject2(wireFormat, (DataStructure)info.getDestination(), dataOut, bs);
|
||||
tightMarshalString2(info.getSelector(), dataOut, bs);
|
||||
tightMarshalString2(info.getSubcriptionName(), dataOut, bs);
|
||||
tightMarshalString2(info.getSubscriptionName(), dataOut, bs);
|
||||
|
||||
}
|
||||
|
||||
|
@ -123,7 +123,7 @@ public class SubscriptionInfoMarshaller extends BaseDataStreamMarshaller {
|
|||
info.setClientId(looseUnmarshalString(dataIn));
|
||||
info.setDestination((org.apache.activemq.command.ActiveMQDestination) looseUnmarsalCachedObject(wireFormat, dataIn));
|
||||
info.setSelector(looseUnmarshalString(dataIn));
|
||||
info.setSubcriptionName(looseUnmarshalString(dataIn));
|
||||
info.setSubscriptionName(looseUnmarshalString(dataIn));
|
||||
|
||||
}
|
||||
|
||||
|
@ -139,7 +139,7 @@ public class SubscriptionInfoMarshaller extends BaseDataStreamMarshaller {
|
|||
looseMarshalString(info.getClientId(), dataOut);
|
||||
looseMarshalCachedObject(wireFormat, (DataStructure)info.getDestination(), dataOut);
|
||||
looseMarshalString(info.getSelector(), dataOut);
|
||||
looseMarshalString(info.getSubcriptionName(), dataOut);
|
||||
looseMarshalString(info.getSubscriptionName(), dataOut);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -68,7 +68,7 @@ public class RemoveSubscriptionInfoMarshaller extends BaseCommandMarshaller {
|
|||
|
||||
RemoveSubscriptionInfo info = (RemoveSubscriptionInfo)o;
|
||||
info.setConnectionId((org.apache.activemq.command.ConnectionId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
|
||||
info.setSubcriptionName(tightUnmarshalString(dataIn, bs));
|
||||
info.setSubscriptionName(tightUnmarshalString(dataIn, bs));
|
||||
info.setClientId(tightUnmarshalString(dataIn, bs));
|
||||
|
||||
}
|
||||
|
@ -83,7 +83,7 @@ public class RemoveSubscriptionInfoMarshaller extends BaseCommandMarshaller {
|
|||
|
||||
int rc = super.tightMarshal1(wireFormat, o, bs);
|
||||
rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getConnectionId(), bs);
|
||||
rc += tightMarshalString1(info.getSubcriptionName(), bs);
|
||||
rc += tightMarshalString1(info.getSubscriptionName(), bs);
|
||||
rc += tightMarshalString1(info.getClientId(), bs);
|
||||
|
||||
return rc + 0;
|
||||
|
@ -101,7 +101,7 @@ public class RemoveSubscriptionInfoMarshaller extends BaseCommandMarshaller {
|
|||
|
||||
RemoveSubscriptionInfo info = (RemoveSubscriptionInfo)o;
|
||||
tightMarshalCachedObject2(wireFormat, (DataStructure)info.getConnectionId(), dataOut, bs);
|
||||
tightMarshalString2(info.getSubcriptionName(), dataOut, bs);
|
||||
tightMarshalString2(info.getSubscriptionName(), dataOut, bs);
|
||||
tightMarshalString2(info.getClientId(), dataOut, bs);
|
||||
|
||||
}
|
||||
|
@ -118,7 +118,7 @@ public class RemoveSubscriptionInfoMarshaller extends BaseCommandMarshaller {
|
|||
|
||||
RemoveSubscriptionInfo info = (RemoveSubscriptionInfo)o;
|
||||
info.setConnectionId((org.apache.activemq.command.ConnectionId) looseUnmarsalCachedObject(wireFormat, dataIn));
|
||||
info.setSubcriptionName(looseUnmarshalString(dataIn));
|
||||
info.setSubscriptionName(looseUnmarshalString(dataIn));
|
||||
info.setClientId(looseUnmarshalString(dataIn));
|
||||
|
||||
}
|
||||
|
@ -133,7 +133,7 @@ public class RemoveSubscriptionInfoMarshaller extends BaseCommandMarshaller {
|
|||
|
||||
super.looseMarshal(wireFormat, o, dataOut);
|
||||
looseMarshalCachedObject(wireFormat, (DataStructure)info.getConnectionId(), dataOut);
|
||||
looseMarshalString(info.getSubcriptionName(), dataOut);
|
||||
looseMarshalString(info.getSubscriptionName(), dataOut);
|
||||
looseMarshalString(info.getClientId(), dataOut);
|
||||
|
||||
}
|
||||
|
|
|
@ -70,7 +70,7 @@ public class SubscriptionInfoMarshaller extends BaseDataStreamMarshaller {
|
|||
info.setClientId(tightUnmarshalString(dataIn, bs));
|
||||
info.setDestination((org.apache.activemq.command.ActiveMQDestination) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
|
||||
info.setSelector(tightUnmarshalString(dataIn, bs));
|
||||
info.setSubcriptionName(tightUnmarshalString(dataIn, bs));
|
||||
info.setSubscriptionName(tightUnmarshalString(dataIn, bs));
|
||||
info.setSubscribedDestination((org.apache.activemq.command.ActiveMQDestination) tightUnmarsalNestedObject(wireFormat, dataIn, bs));
|
||||
|
||||
}
|
||||
|
@ -87,7 +87,7 @@ public class SubscriptionInfoMarshaller extends BaseDataStreamMarshaller {
|
|||
rc += tightMarshalString1(info.getClientId(), bs);
|
||||
rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getDestination(), bs);
|
||||
rc += tightMarshalString1(info.getSelector(), bs);
|
||||
rc += tightMarshalString1(info.getSubcriptionName(), bs);
|
||||
rc += tightMarshalString1(info.getSubscriptionName(), bs);
|
||||
rc += tightMarshalNestedObject1(wireFormat, (DataStructure)info.getSubscribedDestination(), bs);
|
||||
|
||||
return rc + 0;
|
||||
|
@ -107,7 +107,7 @@ public class SubscriptionInfoMarshaller extends BaseDataStreamMarshaller {
|
|||
tightMarshalString2(info.getClientId(), dataOut, bs);
|
||||
tightMarshalCachedObject2(wireFormat, (DataStructure)info.getDestination(), dataOut, bs);
|
||||
tightMarshalString2(info.getSelector(), dataOut, bs);
|
||||
tightMarshalString2(info.getSubcriptionName(), dataOut, bs);
|
||||
tightMarshalString2(info.getSubscriptionName(), dataOut, bs);
|
||||
tightMarshalNestedObject2(wireFormat, (DataStructure)info.getSubscribedDestination(), dataOut, bs);
|
||||
|
||||
}
|
||||
|
@ -126,7 +126,7 @@ public class SubscriptionInfoMarshaller extends BaseDataStreamMarshaller {
|
|||
info.setClientId(looseUnmarshalString(dataIn));
|
||||
info.setDestination((org.apache.activemq.command.ActiveMQDestination) looseUnmarsalCachedObject(wireFormat, dataIn));
|
||||
info.setSelector(looseUnmarshalString(dataIn));
|
||||
info.setSubcriptionName(looseUnmarshalString(dataIn));
|
||||
info.setSubscriptionName(looseUnmarshalString(dataIn));
|
||||
info.setSubscribedDestination((org.apache.activemq.command.ActiveMQDestination) looseUnmarsalNestedObject(wireFormat, dataIn));
|
||||
|
||||
}
|
||||
|
@ -143,7 +143,7 @@ public class SubscriptionInfoMarshaller extends BaseDataStreamMarshaller {
|
|||
looseMarshalString(info.getClientId(), dataOut);
|
||||
looseMarshalCachedObject(wireFormat, (DataStructure)info.getDestination(), dataOut);
|
||||
looseMarshalString(info.getSelector(), dataOut);
|
||||
looseMarshalString(info.getSubcriptionName(), dataOut);
|
||||
looseMarshalString(info.getSubscriptionName(), dataOut);
|
||||
looseMarshalNestedObject(wireFormat, (DataStructure)info.getSubscribedDestination(), dataOut);
|
||||
|
||||
}
|
||||
|
|
|
@ -67,7 +67,7 @@ public class RemoveSubscriptionInfoMarshaller extends BaseCommandMarshaller {
|
|||
|
||||
RemoveSubscriptionInfo info = (RemoveSubscriptionInfo)o;
|
||||
info.setConnectionId((org.apache.activemq.command.ConnectionId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
|
||||
info.setSubcriptionName(tightUnmarshalString(dataIn, bs));
|
||||
info.setSubscriptionName(tightUnmarshalString(dataIn, bs));
|
||||
info.setClientId(tightUnmarshalString(dataIn, bs));
|
||||
|
||||
}
|
||||
|
@ -82,7 +82,7 @@ public class RemoveSubscriptionInfoMarshaller extends BaseCommandMarshaller {
|
|||
|
||||
int rc = super.tightMarshal1(wireFormat, o, bs);
|
||||
rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getConnectionId(), bs);
|
||||
rc += tightMarshalString1(info.getSubcriptionName(), bs);
|
||||
rc += tightMarshalString1(info.getSubscriptionName(), bs);
|
||||
rc += tightMarshalString1(info.getClientId(), bs);
|
||||
|
||||
return rc + 0;
|
||||
|
@ -100,7 +100,7 @@ public class RemoveSubscriptionInfoMarshaller extends BaseCommandMarshaller {
|
|||
|
||||
RemoveSubscriptionInfo info = (RemoveSubscriptionInfo)o;
|
||||
tightMarshalCachedObject2(wireFormat, (DataStructure)info.getConnectionId(), dataOut, bs);
|
||||
tightMarshalString2(info.getSubcriptionName(), dataOut, bs);
|
||||
tightMarshalString2(info.getSubscriptionName(), dataOut, bs);
|
||||
tightMarshalString2(info.getClientId(), dataOut, bs);
|
||||
|
||||
}
|
||||
|
@ -117,7 +117,7 @@ public class RemoveSubscriptionInfoMarshaller extends BaseCommandMarshaller {
|
|||
|
||||
RemoveSubscriptionInfo info = (RemoveSubscriptionInfo)o;
|
||||
info.setConnectionId((org.apache.activemq.command.ConnectionId) looseUnmarsalCachedObject(wireFormat, dataIn));
|
||||
info.setSubcriptionName(looseUnmarshalString(dataIn));
|
||||
info.setSubscriptionName(looseUnmarshalString(dataIn));
|
||||
info.setClientId(looseUnmarshalString(dataIn));
|
||||
|
||||
}
|
||||
|
@ -132,7 +132,7 @@ public class RemoveSubscriptionInfoMarshaller extends BaseCommandMarshaller {
|
|||
|
||||
super.looseMarshal(wireFormat, o, dataOut);
|
||||
looseMarshalCachedObject(wireFormat, (DataStructure)info.getConnectionId(), dataOut);
|
||||
looseMarshalString(info.getSubcriptionName(), dataOut);
|
||||
looseMarshalString(info.getSubscriptionName(), dataOut);
|
||||
looseMarshalString(info.getClientId(), dataOut);
|
||||
|
||||
}
|
||||
|
|
|
@ -69,7 +69,7 @@ public class SubscriptionInfoMarshaller extends BaseDataStreamMarshaller {
|
|||
info.setClientId(tightUnmarshalString(dataIn, bs));
|
||||
info.setDestination((org.apache.activemq.command.ActiveMQDestination) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
|
||||
info.setSelector(tightUnmarshalString(dataIn, bs));
|
||||
info.setSubcriptionName(tightUnmarshalString(dataIn, bs));
|
||||
info.setSubscriptionName(tightUnmarshalString(dataIn, bs));
|
||||
info.setSubscribedDestination((org.apache.activemq.command.ActiveMQDestination) tightUnmarsalNestedObject(wireFormat, dataIn, bs));
|
||||
|
||||
}
|
||||
|
@ -86,7 +86,7 @@ public class SubscriptionInfoMarshaller extends BaseDataStreamMarshaller {
|
|||
rc += tightMarshalString1(info.getClientId(), bs);
|
||||
rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getDestination(), bs);
|
||||
rc += tightMarshalString1(info.getSelector(), bs);
|
||||
rc += tightMarshalString1(info.getSubcriptionName(), bs);
|
||||
rc += tightMarshalString1(info.getSubscriptionName(), bs);
|
||||
rc += tightMarshalNestedObject1(wireFormat, (DataStructure)info.getSubscribedDestination(), bs);
|
||||
|
||||
return rc + 0;
|
||||
|
@ -106,7 +106,7 @@ public class SubscriptionInfoMarshaller extends BaseDataStreamMarshaller {
|
|||
tightMarshalString2(info.getClientId(), dataOut, bs);
|
||||
tightMarshalCachedObject2(wireFormat, (DataStructure)info.getDestination(), dataOut, bs);
|
||||
tightMarshalString2(info.getSelector(), dataOut, bs);
|
||||
tightMarshalString2(info.getSubcriptionName(), dataOut, bs);
|
||||
tightMarshalString2(info.getSubscriptionName(), dataOut, bs);
|
||||
tightMarshalNestedObject2(wireFormat, (DataStructure)info.getSubscribedDestination(), dataOut, bs);
|
||||
|
||||
}
|
||||
|
@ -125,7 +125,7 @@ public class SubscriptionInfoMarshaller extends BaseDataStreamMarshaller {
|
|||
info.setClientId(looseUnmarshalString(dataIn));
|
||||
info.setDestination((org.apache.activemq.command.ActiveMQDestination) looseUnmarsalCachedObject(wireFormat, dataIn));
|
||||
info.setSelector(looseUnmarshalString(dataIn));
|
||||
info.setSubcriptionName(looseUnmarshalString(dataIn));
|
||||
info.setSubscriptionName(looseUnmarshalString(dataIn));
|
||||
info.setSubscribedDestination((org.apache.activemq.command.ActiveMQDestination) looseUnmarsalNestedObject(wireFormat, dataIn));
|
||||
|
||||
}
|
||||
|
@ -142,7 +142,7 @@ public class SubscriptionInfoMarshaller extends BaseDataStreamMarshaller {
|
|||
looseMarshalString(info.getClientId(), dataOut);
|
||||
looseMarshalCachedObject(wireFormat, (DataStructure)info.getDestination(), dataOut);
|
||||
looseMarshalString(info.getSelector(), dataOut);
|
||||
looseMarshalString(info.getSubcriptionName(), dataOut);
|
||||
looseMarshalString(info.getSubscriptionName(), dataOut);
|
||||
looseMarshalNestedObject(wireFormat, (DataStructure)info.getSubscribedDestination(), dataOut);
|
||||
|
||||
}
|
||||
|
|
|
@ -67,7 +67,7 @@ public class RemoveSubscriptionInfoMarshaller extends BaseCommandMarshaller {
|
|||
|
||||
RemoveSubscriptionInfo info = (RemoveSubscriptionInfo)o;
|
||||
info.setConnectionId((org.apache.activemq.command.ConnectionId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
|
||||
info.setSubcriptionName(tightUnmarshalString(dataIn, bs));
|
||||
info.setSubscriptionName(tightUnmarshalString(dataIn, bs));
|
||||
info.setClientId(tightUnmarshalString(dataIn, bs));
|
||||
|
||||
}
|
||||
|
@ -82,7 +82,7 @@ public class RemoveSubscriptionInfoMarshaller extends BaseCommandMarshaller {
|
|||
|
||||
int rc = super.tightMarshal1(wireFormat, o, bs);
|
||||
rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getConnectionId(), bs);
|
||||
rc += tightMarshalString1(info.getSubcriptionName(), bs);
|
||||
rc += tightMarshalString1(info.getSubscriptionName(), bs);
|
||||
rc += tightMarshalString1(info.getClientId(), bs);
|
||||
|
||||
return rc + 0;
|
||||
|
@ -100,7 +100,7 @@ public class RemoveSubscriptionInfoMarshaller extends BaseCommandMarshaller {
|
|||
|
||||
RemoveSubscriptionInfo info = (RemoveSubscriptionInfo)o;
|
||||
tightMarshalCachedObject2(wireFormat, (DataStructure)info.getConnectionId(), dataOut, bs);
|
||||
tightMarshalString2(info.getSubcriptionName(), dataOut, bs);
|
||||
tightMarshalString2(info.getSubscriptionName(), dataOut, bs);
|
||||
tightMarshalString2(info.getClientId(), dataOut, bs);
|
||||
|
||||
}
|
||||
|
@ -117,7 +117,7 @@ public class RemoveSubscriptionInfoMarshaller extends BaseCommandMarshaller {
|
|||
|
||||
RemoveSubscriptionInfo info = (RemoveSubscriptionInfo)o;
|
||||
info.setConnectionId((org.apache.activemq.command.ConnectionId) looseUnmarsalCachedObject(wireFormat, dataIn));
|
||||
info.setSubcriptionName(looseUnmarshalString(dataIn));
|
||||
info.setSubscriptionName(looseUnmarshalString(dataIn));
|
||||
info.setClientId(looseUnmarshalString(dataIn));
|
||||
|
||||
}
|
||||
|
@ -132,7 +132,7 @@ public class RemoveSubscriptionInfoMarshaller extends BaseCommandMarshaller {
|
|||
|
||||
super.looseMarshal(wireFormat, o, dataOut);
|
||||
looseMarshalCachedObject(wireFormat, (DataStructure)info.getConnectionId(), dataOut);
|
||||
looseMarshalString(info.getSubcriptionName(), dataOut);
|
||||
looseMarshalString(info.getSubscriptionName(), dataOut);
|
||||
looseMarshalString(info.getClientId(), dataOut);
|
||||
|
||||
}
|
||||
|
|
|
@ -69,7 +69,7 @@ public class SubscriptionInfoMarshaller extends BaseDataStreamMarshaller {
|
|||
info.setClientId(tightUnmarshalString(dataIn, bs));
|
||||
info.setDestination((org.apache.activemq.command.ActiveMQDestination) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
|
||||
info.setSelector(tightUnmarshalString(dataIn, bs));
|
||||
info.setSubcriptionName(tightUnmarshalString(dataIn, bs));
|
||||
info.setSubscriptionName(tightUnmarshalString(dataIn, bs));
|
||||
info.setSubscribedDestination((org.apache.activemq.command.ActiveMQDestination) tightUnmarsalNestedObject(wireFormat, dataIn, bs));
|
||||
|
||||
}
|
||||
|
@ -86,7 +86,7 @@ public class SubscriptionInfoMarshaller extends BaseDataStreamMarshaller {
|
|||
rc += tightMarshalString1(info.getClientId(), bs);
|
||||
rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getDestination(), bs);
|
||||
rc += tightMarshalString1(info.getSelector(), bs);
|
||||
rc += tightMarshalString1(info.getSubcriptionName(), bs);
|
||||
rc += tightMarshalString1(info.getSubscriptionName(), bs);
|
||||
rc += tightMarshalNestedObject1(wireFormat, (DataStructure)info.getSubscribedDestination(), bs);
|
||||
|
||||
return rc + 0;
|
||||
|
@ -106,7 +106,7 @@ public class SubscriptionInfoMarshaller extends BaseDataStreamMarshaller {
|
|||
tightMarshalString2(info.getClientId(), dataOut, bs);
|
||||
tightMarshalCachedObject2(wireFormat, (DataStructure)info.getDestination(), dataOut, bs);
|
||||
tightMarshalString2(info.getSelector(), dataOut, bs);
|
||||
tightMarshalString2(info.getSubcriptionName(), dataOut, bs);
|
||||
tightMarshalString2(info.getSubscriptionName(), dataOut, bs);
|
||||
tightMarshalNestedObject2(wireFormat, (DataStructure)info.getSubscribedDestination(), dataOut, bs);
|
||||
|
||||
}
|
||||
|
@ -125,7 +125,7 @@ public class SubscriptionInfoMarshaller extends BaseDataStreamMarshaller {
|
|||
info.setClientId(looseUnmarshalString(dataIn));
|
||||
info.setDestination((org.apache.activemq.command.ActiveMQDestination) looseUnmarsalCachedObject(wireFormat, dataIn));
|
||||
info.setSelector(looseUnmarshalString(dataIn));
|
||||
info.setSubcriptionName(looseUnmarshalString(dataIn));
|
||||
info.setSubscriptionName(looseUnmarshalString(dataIn));
|
||||
info.setSubscribedDestination((org.apache.activemq.command.ActiveMQDestination) looseUnmarsalNestedObject(wireFormat, dataIn));
|
||||
|
||||
}
|
||||
|
@ -142,7 +142,7 @@ public class SubscriptionInfoMarshaller extends BaseDataStreamMarshaller {
|
|||
looseMarshalString(info.getClientId(), dataOut);
|
||||
looseMarshalCachedObject(wireFormat, (DataStructure)info.getDestination(), dataOut);
|
||||
looseMarshalString(info.getSelector(), dataOut);
|
||||
looseMarshalString(info.getSubcriptionName(), dataOut);
|
||||
looseMarshalString(info.getSubscriptionName(), dataOut);
|
||||
looseMarshalNestedObject(wireFormat, (DataStructure)info.getSubscribedDestination(), dataOut);
|
||||
|
||||
}
|
||||
|
|
|
@ -1,123 +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.activemq.util;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.beans.factory.FactoryBean;
|
||||
import org.springframework.beans.propertyeditors.ClassEditor;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import com.thoughtworks.xstream.XStream;
|
||||
import com.thoughtworks.xstream.annotations.Annotations;
|
||||
import com.thoughtworks.xstream.converters.Converter;
|
||||
import com.thoughtworks.xstream.converters.ConverterMatcher;
|
||||
import com.thoughtworks.xstream.converters.SingleValueConverter;
|
||||
|
||||
public class XStreamFactoryBean implements FactoryBean {
|
||||
|
||||
XStream xstream = new XStream();
|
||||
|
||||
/**
|
||||
* Sets the <code>Converters</code> or <code>SingleValueConverters</code> to be registered with the
|
||||
* <code>XStream</code> instance.
|
||||
*
|
||||
* @see Converter
|
||||
* @see SingleValueConverter
|
||||
*/
|
||||
public void setConverters(ConverterMatcher[] converters) {
|
||||
for (int i = 0; i < converters.length; i++) {
|
||||
if (converters[i] instanceof Converter) {
|
||||
xstream.registerConverter((Converter) converters[i], i);
|
||||
}
|
||||
else if (converters[i] instanceof SingleValueConverter) {
|
||||
xstream.registerConverter((SingleValueConverter) converters[i], i);
|
||||
}
|
||||
else {
|
||||
throw new IllegalArgumentException("Invalid ConverterMatcher [" + converters[i] + "]");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a alias/type map, consisting of string aliases mapped to <code>Class</code> instances (or Strings to be
|
||||
* converted to <code>Class</code> instances).
|
||||
*
|
||||
* @see org.springframework.beans.propertyeditors.ClassEditor
|
||||
*/
|
||||
public void setAliases(Map aliases) {
|
||||
for (Iterator iterator = aliases.entrySet().iterator(); iterator.hasNext();) {
|
||||
Map.Entry entry = (Map.Entry) iterator.next();
|
||||
// Check whether we need to convert from String to Class.
|
||||
Class type;
|
||||
if (entry.getValue() instanceof Class) {
|
||||
type = (Class) entry.getValue();
|
||||
}
|
||||
else {
|
||||
ClassEditor editor = new ClassEditor();
|
||||
editor.setAsText(String.valueOf(entry.getValue()));
|
||||
type = (Class) editor.getValue();
|
||||
}
|
||||
xstream.alias((String) entry.getKey(), type);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the XStream mode.
|
||||
*
|
||||
* @see XStream#XPATH_REFERENCES
|
||||
* @see XStream#ID_REFERENCES
|
||||
* @see XStream#NO_REFERENCES
|
||||
*/
|
||||
public void setMode(int mode) {
|
||||
xstream.setMode(mode);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the classes, for which mappings will be read from class-level JDK 1.5+ annotation metadata.
|
||||
*
|
||||
* @see Annotations#configureAliases(XStream, Class[])
|
||||
*/
|
||||
public void setAnnotatedClass(Class<?> annotatedClass) {
|
||||
Assert.notNull(annotatedClass, "'annotatedClass' must not be null");
|
||||
Annotations.configureAliases(xstream, annotatedClass);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets annotated classes, for which aliases will be read from class-level JDK 1.5+ annotation metadata.
|
||||
*
|
||||
* @see Annotations#configureAliases(XStream, Class[])
|
||||
*/
|
||||
public void setAnnotatedClasses(Class<?>[] annotatedClasses) {
|
||||
Assert.notEmpty(annotatedClasses, "'annotatedClasses' must not be empty");
|
||||
Annotations.configureAliases(xstream, annotatedClasses);
|
||||
}
|
||||
|
||||
public Object getObject() throws Exception {
|
||||
return xstream;
|
||||
}
|
||||
|
||||
public Class getObjectType() {
|
||||
return XStream.class;
|
||||
}
|
||||
|
||||
public boolean isSingleton() {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
|
@ -115,16 +115,16 @@ public abstract class CombinationTestSupport extends AutoFailTestSupport {
|
|||
|
||||
private CombinationTestSupport[] getCombinations() {
|
||||
try {
|
||||
Method method = getClass().getMethod("initCombos", null);
|
||||
method.invoke(this, null);
|
||||
Method method = getClass().getMethod("initCombos", (Class[])null);
|
||||
method.invoke(this, (Object[])null);
|
||||
} catch (Throwable e) {
|
||||
}
|
||||
|
||||
String name = getName().split(" ")[0];
|
||||
String comboSetupMethodName = "initCombosFor" + Character.toUpperCase(name.charAt(0)) + name.substring(1);
|
||||
try {
|
||||
Method method = getClass().getMethod(comboSetupMethodName, null);
|
||||
method.invoke(this, null);
|
||||
Method method = getClass().getMethod(comboSetupMethodName, (Class[])null);
|
||||
method.invoke(this, (Object[])null);
|
||||
} catch (Throwable e) {
|
||||
}
|
||||
|
||||
|
|
|
@ -127,7 +127,7 @@ public abstract class DataStructureTestSupport extends CombinationTestSupport {
|
|||
}
|
||||
|
||||
try {
|
||||
assertEquals(method.invoke(expect, null), method.invoke(was, null));
|
||||
assertEquals(method.invoke(expect, (Object)null), method.invoke(was, (Object)null));
|
||||
} catch (IllegalArgumentException e) {
|
||||
} catch (IllegalAccessException e) {
|
||||
} catch (InvocationTargetException e) {
|
||||
|
|
|
@ -42,7 +42,7 @@ public class RemoveSubscriptionInfoTest extends BaseCommandTestSupport {
|
|||
super.populateObject(object);
|
||||
RemoveSubscriptionInfo info = (RemoveSubscriptionInfo)object;
|
||||
info.setConnectionId(createConnectionId("ConnectionId:1"));
|
||||
info.setSubcriptionName("SubcriptionName:2");
|
||||
info.setSubscriptionName("SubcriptionName:2");
|
||||
info.setClientId("ClientId:3");
|
||||
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ public class SubscriptionInfoTest extends DataFileGeneratorTestSupport {
|
|||
info.setClientId("ClientId:1");
|
||||
info.setDestination(createActiveMQDestination("Destination:2"));
|
||||
info.setSelector("Selector:3");
|
||||
info.setSubcriptionName("SubcriptionName:4");
|
||||
info.setSubscriptionName("SubcriptionName:4");
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ public class RemoveSubscriptionInfoTest extends BaseCommandTestSupport {
|
|||
RemoveSubscriptionInfo info = (RemoveSubscriptionInfo) object;
|
||||
|
||||
info.setConnectionId(createConnectionId("ConnectionId:1"));
|
||||
info.setSubcriptionName("SubcriptionName:2");
|
||||
info.setSubscriptionName("SubcriptionName:2");
|
||||
info.setClientId("ClientId:3");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -49,6 +49,6 @@ public class SubscriptionInfoTest extends DataFileGeneratorTestSupport {
|
|||
info.setClientId("ClientId:1");
|
||||
info.setDestination(createActiveMQDestination("Destination:2"));
|
||||
info.setSelector("Selector:3");
|
||||
info.setSubcriptionName("SubcriptionName:4");
|
||||
info.setSubscriptionName("SubcriptionName:4");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ public class RemoveSubscriptionInfoTest extends BaseCommandTestSupport {
|
|||
RemoveSubscriptionInfo info = (RemoveSubscriptionInfo) object;
|
||||
|
||||
info.setConnectionId(createConnectionId("ConnectionId:1"));
|
||||
info.setSubcriptionName("SubcriptionName:2");
|
||||
info.setSubscriptionName("SubcriptionName:2");
|
||||
info.setClientId("ClientId:3");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@ public class SubscriptionInfoTest extends DataFileGeneratorTestSupport {
|
|||
info.setClientId("ClientId:1");
|
||||
info.setDestination(createActiveMQDestination("Destination:2"));
|
||||
info.setSelector("Selector:3");
|
||||
info.setSubcriptionName("SubcriptionName:4");
|
||||
info.setSubscriptionName("SubcriptionName:4");
|
||||
info.setSubscribedDestination(createActiveMQDestination("SubscribedDestination:5"));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@ public class RemoveSubscriptionInfoTest extends BaseCommandTestSupport {
|
|||
RemoveSubscriptionInfo info = (RemoveSubscriptionInfo) object;
|
||||
|
||||
info.setConnectionId(createConnectionId("ConnectionId:1"));
|
||||
info.setSubcriptionName("SubcriptionName:2");
|
||||
info.setSubscriptionName("SubcriptionName:2");
|
||||
info.setClientId("ClientId:3");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -54,7 +54,7 @@ public class SubscriptionInfoTest extends DataFileGeneratorTestSupport {
|
|||
info.setClientId("ClientId:1");
|
||||
info.setDestination(createActiveMQDestination("Destination:2"));
|
||||
info.setSelector("Selector:3");
|
||||
info.setSubcriptionName("SubcriptionName:4");
|
||||
info.setSubscriptionName("SubcriptionName:4");
|
||||
info.setSubscribedDestination(createActiveMQDestination("SubscribedDestination:5"));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@ public class RemoveSubscriptionInfoTest extends BaseCommandTestSupport {
|
|||
RemoveSubscriptionInfo info = (RemoveSubscriptionInfo) object;
|
||||
|
||||
info.setConnectionId(createConnectionId("ConnectionId:1"));
|
||||
info.setSubcriptionName("SubcriptionName:2");
|
||||
info.setSubscriptionName("SubcriptionName:2");
|
||||
info.setClientId("ClientId:3");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -54,7 +54,7 @@ public class SubscriptionInfoTest extends DataFileGeneratorTestSupport {
|
|||
info.setClientId("ClientId:1");
|
||||
info.setDestination(createActiveMQDestination("Destination:2"));
|
||||
info.setSelector("Selector:3");
|
||||
info.setSubcriptionName("SubcriptionName:4");
|
||||
info.setSubscriptionName("SubcriptionName:4");
|
||||
info.setSubscribedDestination(createActiveMQDestination("SubscribedDestination:5"));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,6 +32,7 @@ import junit.textui.TestRunner;
|
|||
|
||||
import org.apache.activemq.broker.BrokerService;
|
||||
import org.apache.activemq.broker.SslBrokerService;
|
||||
import org.apache.activemq.broker.SslContext;
|
||||
import org.apache.activemq.transport.TransportBrokerTestSupport;
|
||||
import org.apache.activemq.transport.TransportFactory;
|
||||
|
||||
|
@ -52,7 +53,8 @@ public class SslBrokerServiceTest extends TransportBrokerTestSupport {
|
|||
|
||||
// for client side
|
||||
SslTransportFactory sslFactory = new SslTransportFactory();
|
||||
sslFactory.setKeyAndTrustManagers(km, tm, null);
|
||||
SslContext ctx = new SslContext(km, tm, null);
|
||||
SslContext.setCurrentSslContext(ctx);
|
||||
TransportFactory.registerTransportFactory("ssl", sslFactory);
|
||||
|
||||
return service;
|
||||
|
|
Loading…
Reference in New Issue