class BufferPool15Impl implements BufferPool.BufferPoolAPI {
protected int maxSize;
protected AtomicInteger size = new AtomicInteger(0);
- protected ConcurrentLinkedQueue queue = new ConcurrentLinkedQueue();
+ protected ConcurrentLinkedQueue<XByteBuffer> queue = new ConcurrentLinkedQueue<XByteBuffer>();
public void setMaxSize(int bytes) {
this.maxSize = bytes;
public XByteBuffer getBuffer(int minSize, boolean discard) {
- XByteBuffer buffer = (XByteBuffer)queue.poll();
+ XByteBuffer buffer = queue.poll();
if ( buffer != null ) size.addAndGet(-buffer.getCapacity());
if ( buffer == null ) buffer = new XByteBuffer(minSize,discard);
else if ( buffer.getCapacity() <= minSize ) buffer.expand(minSize);
* @exception ClassNotFoundException if this class cannot be found
* @exception IOException if an input/output error occurs
*/
- public Class resolveClass(ObjectStreamClass classDesc)
+ public Class<?> resolveClass(ObjectStreamClass classDesc)
throws ClassNotFoundException, IOException {
String name = classDesc.getName();
try {
}
}
- public Class resolveClass(String name)
+ public Class<?> resolveClass(String name)
throws ClassNotFoundException, IOException {
boolean tryRepFirst = name.startsWith("org.apache.catalina.tribes");
boolean hasNonPublicInterface = false;
// define proxy in class loader of non-public interface(s), if any
- Class[] classObjs = new Class[interfaces.length];
+ Class<?>[] classObjs = new Class[interfaces.length];
for (int i = 0; i < interfaces.length; i++) {
- Class cl = this.resolveClass(interfaces[i]);
+ Class<?> cl = this.resolveClass(interfaces[i]);
if (latestLoader==null) latestLoader = cl.getClassLoader();
if ((cl.getModifiers() & Modifier.PUBLIC) == 0) {
if (hasNonPublicInterface) {
}
- public Class findReplicationClass(String name)
+ public Class<?> findReplicationClass(String name)
throws ClassNotFoundException, IOException {
- Class clazz = Class.forName(name, false, getClass().getClassLoader());
+ Class<?> clazz = Class.forName(name, false, getClass().getClassLoader());
return clazz;
}
- public Class findExternalClass(String name) throws ClassNotFoundException {
+ public Class<?> findExternalClass(String name) throws ClassNotFoundException {
ClassNotFoundException cnfe = null;
for (int i=0; i<classLoaders.length; i++ ) {
try {
- Class clazz = Class.forName(name, false, classLoaders[i]);
+ Class<?> clazz = Class.forName(name, false, classLoaders[i]);
return clazz;
} catch ( ClassNotFoundException x ) {
cnfe = x;
public static final byte[] END_DATA = {84,76,70,50,48,48,51};
/**
- * Default size on the initial byte buffer
- */
- private static final int DEF_SIZE = 2048;
-
- /**
- * Default size to extend the buffer with
- */
- private static final int DEF_EXT = 1024;
-
- /**
* Variable to hold the data
*/
protected byte[] buf = null;
* @exception java.lang.ArrayIndexOutOfBoundsException
*/
public static int toInt(byte[] b,int off){
- return ( ( (int) b[off+3]) & 0xFF) +
- ( ( ( (int) b[off+2]) & 0xFF) << 8) +
- ( ( ( (int) b[off+1]) & 0xFF) << 16) +
- ( ( ( (int) b[off+0]) & 0xFF) << 24);
+ return ( ( b[off+3]) & 0xFF) +
+ ( ( ( b[off+2]) & 0xFF) << 8) +
+ ( ( ( b[off+1]) & 0xFF) << 16) +
+ ( ( ( b[off+0]) & 0xFF) << 24);
}
/**