Modified: geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/naming/InitialContextFactory.java URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/naming/InitialContextFactory.java?view=diff&r1=158861&r2=158862 ============================================================================== --- geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/naming/InitialContextFactory.java (original) +++ geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/naming/InitialContextFactory.java Wed Mar 23 18:30:30 2005 @@ -19,6 +19,7 @@ import java.util.Hashtable; + public class InitialContextFactory implements javax.naming.spi.InitialContextFactory { public javax.naming.Context getInitialContext(Hashtable env) {
Modified: geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/naming/NameService.java URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/naming/NameService.java?view=diff&r1=158861&r2=158862 ============================================================================== --- geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/naming/NameService.java (original) +++ geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/naming/NameService.java Wed Mar 23 18:30:30 2005 @@ -21,22 +21,25 @@ import javax.naming.NamingException; import org.apache.geronimo.interop.adapter.Adapter; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; + public class NameService { - private static NameService ns = null; - private final Log log = LogFactory.getLog(NameService.class); + protected static NameService _ns = null; - public static synchronized NameService getInstance() { - if (ns == null) { - ns = new NameService(); - ns.init(); + public static NameService getInstance() { + if (_ns == null) { + synchronized (NameService.class) { + if (_ns == null) { + _ns = new NameService(); + _ns.init(); + } + } } - return ns; + + return _ns; } - private org.apache.geronimo.interop.naming.InitialContext context; + private org.apache.geronimo.interop.naming.InitialContext _context; /* * TODO: Do we need this method? @@ -45,23 +48,19 @@ NamingContext.getInstance(NameService.class).bindAdapter(adp); } - public void unbindAdapter(Adapter adp) { - NamingContext.getInstance(NameService.class).unbindAdapter(adp); - } - public static org.apache.geronimo.interop.naming.InitialContext getInitialContext() { - return getInstance().context; + return getInstance()._context; } public HashMap getMap() { - return context.getMap(); + return _context.getMap(); } public Object lookup(String name) throws NamingException { - return context.lookup(name); + return _context.lookup(name); } protected void init() { - context = new org.apache.geronimo.interop.naming.InitialContext(null); + _context = new org.apache.geronimo.interop.naming.InitialContext(null); } } Modified: geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/naming/NamingContext.java URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/naming/NamingContext.java?view=diff&r1=158861&r2=158862 ============================================================================== --- geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/naming/NamingContext.java (original) +++ geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/naming/NamingContext.java Wed Mar 23 18:30:30 2005 @@ -22,55 +22,48 @@ import javax.naming.NamingException; import org.apache.geronimo.interop.adapter.Adapter; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -public class NamingContext { - - private final Log log = LogFactory.getLog(NamingContext.class); +public class NamingContext { public static final NamingContext getInstance(Class baseClass) { NamingContext context; - synchronized (contextMap) { - context = (NamingContext) contextMap.get(baseClass); + synchronized (_contextMap) { + context = (NamingContext) _contextMap.get(baseClass); if (context == null) { context = new NamingContext(); - contextMap.put(baseClass, context); + _contextMap.put(baseClass, context); context.init(baseClass); } } return context; } - private static ThreadLocal current = new ThreadLocal(); - private static HashMap contextMap = new HashMap(); - private static boolean quiet = false; // TODO: Configure - private static boolean verbose = true; // TODO: Configure - private String logContext; - private HashMap map = new HashMap(); + private static ThreadLocal _current = new ThreadLocal(); + private static HashMap _contextMap = new HashMap(); + private static boolean _quiet = false; // TODO: Configure + private static boolean _verbose = true; // TODO: Configure + private String _logContext; + private HashMap _map = new HashMap(); public static final NamingContext getCurrent() { - return (NamingContext) current.get(); + return (NamingContext) _current.get(); } public static final NamingContext push(NamingContext that) { NamingContext restore = getCurrent(); - current.set(that); + _current.set(that); return restore; } public static void pop(NamingContext restore) { - current.set(restore); + _current.set(restore); } public HashMap getMap() { - return map; + return _map; } public Object lookup(String name, String prefix) throws NamingException { - - log.debug( "NameContext.lookup(): name = " + name + ", prefix = " + prefix ); - if (prefix != null) { name += prefix + "/" + name; } @@ -81,19 +74,19 @@ // be performed in 'init' so as to permit this method to be as // fast as possible (i.e. a simple unsynchronized HashMap lookup). - Object value = map.get(name); + Object value = _map.get(name); if (value == null) { value = dynamicLookup(name); if (value != null) { - map.put(name, value); // TODO: allow refresh. + _map.put(name, value); // TODO: allow refresh. } } if (value == null) { NameNotFoundException notFound = new NameNotFoundException(name.length() == 0 ? formatEmptyName() : name); - if (!quiet) { - NameServiceLog.getInstance().warnNameNotFound(logContext, notFound); + if (!_quiet) { + NameServiceLog.getInstance().warnNameNotFound(_logContext, notFound); } throw notFound; } else { @@ -105,7 +98,7 @@ if (prefix != null) { name += prefix + "/" + name; } - return map.get(name); + return _map.get(name); } protected void init(Class baseClass) { @@ -113,31 +106,42 @@ // this logic isn't required for the CORBA container. } - protected synchronized void bindAdapter(Adapter adp) { - String names[] = adp.getBindNames(); - for( int i=0; i<names.length; i++ ) { - log.debug( "NameContext.bindAdapter(): name[" + i + "] = " + names[i] + ", adp = " + adp ); - map.put(names[i], adp); - } - } - - protected synchronized void unbindAdapter( Adapter adp ) { - String names[] = adp.getBindNames(); - for( int i=0; i<names.length; i++ ) - { - log.debug( "NameContext.bindAdapter(): name[" + i + "] = " + names[i] + ", adp = " + adp ); - map.remove( names[i] ); - } + protected void bindAdapter(Adapter adp) { + _map.put(adp.getBindName(), adp); } protected boolean adapterExists(String name) { System.out.println("TODO: NamingComponent.componentExists(): name = " + name); + + //String propsFileName = SystemProperties.getRepository() + "/Component/" + name.replace('.', '/') + ".properties"; + //return new java.io.File(propsFileName).exists(); + return false; } protected Object dynamicLookup(String name) { return null; } + + /* + protected List getComponentsForInterface(String interfaceName) + { + return null; + } + */ + + /* + protected String resolveComponent(String name, String pattern) + { + return ""; + } + */ + + /* + protected void copyObjectsWithRemoteInterface(final HashMap intoMap) + { + } + */ protected String formatEmptyName() { return "formatEmptyName:"; Modified: geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/properties/BooleanProperty.java URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/properties/BooleanProperty.java?view=diff&r1=158861&r2=158862 ============================================================================== --- geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/properties/BooleanProperty.java (original) +++ geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/properties/BooleanProperty.java Wed Mar 23 18:30:30 2005 @@ -18,7 +18,7 @@ package org.apache.geronimo.interop.properties; public class BooleanProperty extends PropertyType { - private boolean defaultValue = false; + private boolean _defaultValue = false; public BooleanProperty(Class componentClass, String propertyName) { super(componentClass, propertyName); @@ -50,16 +50,16 @@ } public BooleanProperty defaultValue(boolean defaultValue) { - defaultValue = defaultValue; + _defaultValue = defaultValue; return this; } public boolean getDefaultValue() { - return defaultValue; + return _defaultValue; } public String getDefaultValueAsString() { - return String.valueOf(defaultValue); + return String.valueOf(_defaultValue); } public boolean getBoolean() { @@ -69,7 +69,7 @@ public boolean getBoolean(String instanceName, PropertyMap props) { boolean b; boolean ok = true; - String value = props.getProperty(getPropertyName(), String.valueOf(defaultValue)); + String value = props.getProperty(_propertyName, String.valueOf(_defaultValue)); value = value.toLowerCase(); if (value.equals("true")) { b = true; @@ -82,7 +82,7 @@ if (!ok) { badPropertyValue(instanceName, value, expectedTrueOrFalse()); } - logPropertyValue(instanceName, value, b == defaultValue); + logPropertyValue(instanceName, value, b == _defaultValue); return b; } } Modified: geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/properties/ByteProperty.java URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/properties/ByteProperty.java?view=diff&r1=158861&r2=158862 ============================================================================== --- geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/properties/ByteProperty.java (original) +++ geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/properties/ByteProperty.java Wed Mar 23 18:30:30 2005 @@ -18,9 +18,11 @@ package org.apache.geronimo.interop.properties; public class ByteProperty extends PropertyType { - private byte defaultValue = 0; - private byte minimumValue = 0; - private byte maximumValue = Byte.MAX_VALUE; + private byte _defaultValue = 0; + + private byte _minimumValue = 0; + + private byte _maximumValue = Byte.MAX_VALUE; public ByteProperty(Class componentClass, String propertyName) { super(componentClass, propertyName); @@ -52,34 +54,34 @@ } public ByteProperty defaultValue(byte defaultValue) { - this.defaultValue = defaultValue; + _defaultValue = defaultValue; return this; } public ByteProperty minimumValue(byte minimumValue) { - this.minimumValue = minimumValue; + _minimumValue = minimumValue; return this; } public ByteProperty maximumValue(byte maximumValue) { - this.maximumValue = maximumValue; + _maximumValue = maximumValue; return this; } public byte getDefaultValue() { - return defaultValue; + return _defaultValue; } public String getDefaultValueAsString() { - return String.valueOf(defaultValue); + return String.valueOf(_defaultValue); } public byte getMinimumValue() { - return minimumValue; + return _minimumValue; } public byte getMaximumValue() { - return maximumValue; + return _maximumValue; } public byte getByte() { @@ -89,20 +91,20 @@ public byte getByte(String instanceName, PropertyMap props) { byte n; boolean ok = true; - String value = props.getProperty(getPropertyName(), String.valueOf(defaultValue)); + String value = props.getProperty(_propertyName, String.valueOf(_defaultValue)); try { n = Byte.parseByte(value); } catch (NumberFormatException ex) { ok = false; n = 0; } - if (n < minimumValue || n > maximumValue) { + if (n < _minimumValue || n > _maximumValue) { ok = false; } if (!ok) { - badPropertyValue(instanceName, value, expectedNumberInRange(minimumValue, maximumValue)); + badPropertyValue(instanceName, value, expectedNumberInRange(_minimumValue, _maximumValue)); } - logPropertyValue(instanceName, value, n == defaultValue); + logPropertyValue(instanceName, value, n == _defaultValue); return n; } } Modified: geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/properties/DoubleProperty.java URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/properties/DoubleProperty.java?view=diff&r1=158861&r2=158862 ============================================================================== --- geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/properties/DoubleProperty.java (original) +++ geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/properties/DoubleProperty.java Wed Mar 23 18:30:30 2005 @@ -17,10 +17,15 @@ */ package org.apache.geronimo.interop.properties; + + + public class DoubleProperty extends PropertyType { - private double defaultValue = 0; - private double minimumValue = 0; - private double maximumValue = Double.MAX_VALUE; + private double _defaultValue = 0; + + private double _minimumValue = 0; + + private double _maximumValue = Double.MAX_VALUE; public DoubleProperty(Class componentClass, String propertyName) { super(componentClass, propertyName); @@ -52,34 +57,34 @@ } public DoubleProperty defaultValue(double defaultValue) { - this.defaultValue = defaultValue; + _defaultValue = defaultValue; return this; } public DoubleProperty minimumValue(double minimumValue) { - this.minimumValue = minimumValue; + _minimumValue = minimumValue; return this; } public DoubleProperty maximumValue(double maximumValue) { - this.maximumValue = maximumValue; + _maximumValue = maximumValue; return this; } public double getDefaultValue() { - return defaultValue; + return _defaultValue; } public String getDefaultValueAsString() { - return String.valueOf(defaultValue); + return String.valueOf(_defaultValue); } public double getMinimumValue() { - return minimumValue; + return _minimumValue; } public double getMaximumValue() { - return maximumValue; + return _maximumValue; } public double getDouble() { @@ -89,20 +94,20 @@ public double getDouble(String instanceName, PropertyMap props) { double n; boolean ok = true; - String value = props.getProperty(getPropertyName(), String.valueOf(defaultValue)); + String value = props.getProperty(_propertyName, String.valueOf(_defaultValue)); try { n = Double.parseDouble(value); } catch (NumberFormatException ex) { ok = false; n = 0; } - if (n < minimumValue || n > maximumValue) { + if (n < _minimumValue || n > _maximumValue) { ok = false; } if (!ok) { - badPropertyValue(instanceName, value, expectedNumberInRange(minimumValue, maximumValue)); + badPropertyValue(instanceName, value, expectedNumberInRange(_minimumValue, _maximumValue)); } - logPropertyValue(instanceName, value, n == defaultValue); + logPropertyValue(instanceName, value, n == _defaultValue); return n; } } Modified: geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/properties/FloatProperty.java URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/properties/FloatProperty.java?view=diff&r1=158861&r2=158862 ============================================================================== --- geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/properties/FloatProperty.java (original) +++ geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/properties/FloatProperty.java Wed Mar 23 18:30:30 2005 @@ -18,9 +18,11 @@ package org.apache.geronimo.interop.properties; public class FloatProperty extends PropertyType { - private float defaultValue = 0; - private float minimumValue = 0; - private float maximumValue = Float.MAX_VALUE; + private float _defaultValue = 0; + + private float _minimumValue = 0; + + private float _maximumValue = Float.MAX_VALUE; public FloatProperty(Class componentClass, String propertyName) { super(componentClass, propertyName); @@ -52,34 +54,34 @@ } public FloatProperty defaultValue(float defaultValue) { - this.defaultValue = defaultValue; + _defaultValue = defaultValue; return this; } public FloatProperty minimumValue(float minimumValue) { - this.minimumValue = minimumValue; + _minimumValue = minimumValue; return this; } public FloatProperty maximumValue(float maximumValue) { - this.maximumValue = maximumValue; + _maximumValue = maximumValue; return this; } public float getDefaultValue() { - return defaultValue; + return _defaultValue; } public String getDefaultValueAsString() { - return String.valueOf(defaultValue); + return String.valueOf(_defaultValue); } public float getMinimumValue() { - return minimumValue; + return _minimumValue; } public float getMaximumValue() { - return maximumValue; + return _maximumValue; } public float getFloat() { @@ -89,20 +91,20 @@ public float getFloat(String instanceName, PropertyMap props) { float n; boolean ok = true; - String value = props.getProperty(getPropertyName(), String.valueOf(defaultValue)); + String value = props.getProperty(_propertyName, String.valueOf(_defaultValue)); try { n = Float.parseFloat(value); } catch (NumberFormatException ex) { ok = false; n = 0; } - if (n < minimumValue || n > maximumValue) { + if (n < _minimumValue || n > _maximumValue) { ok = false; } if (!ok) { - badPropertyValue(instanceName, value, expectedNumberInRange(minimumValue, maximumValue)); + badPropertyValue(instanceName, value, expectedNumberInRange(_minimumValue, _maximumValue)); } - logPropertyValue(instanceName, value, n == defaultValue); + logPropertyValue(instanceName, value, n == _defaultValue); return n; } } Modified: geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/properties/IntProperty.java URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/properties/IntProperty.java?view=diff&r1=158861&r2=158862 ============================================================================== --- geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/properties/IntProperty.java (original) +++ geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/properties/IntProperty.java Wed Mar 23 18:30:30 2005 @@ -18,9 +18,11 @@ package org.apache.geronimo.interop.properties; public class IntProperty extends PropertyType { - private int defaultValue = 0; - private int minimumValue = 0; - private int maximumValue = Integer.MAX_VALUE; + private int _defaultValue = 0; + + private int _minimumValue = 0; + + private int _maximumValue = Integer.MAX_VALUE; public IntProperty(Class componentClass, String propertyName) { super(componentClass, propertyName); @@ -52,34 +54,34 @@ } public IntProperty defaultValue(int defaultValue) { - this.defaultValue = defaultValue; + _defaultValue = defaultValue; return this; } public IntProperty minimumValue(int minimumValue) { - this.minimumValue = minimumValue; + _minimumValue = minimumValue; return this; } public IntProperty maximumValue(int maximumValue) { - this.maximumValue = maximumValue; + _maximumValue = maximumValue; return this; } public int getDefaultValue() { - return defaultValue; + return _defaultValue; } public String getDefaultValueAsString() { - return String.valueOf(defaultValue); + return String.valueOf(_defaultValue); } public int getMinimumValue() { - return minimumValue; + return _minimumValue; } public int getMaximumValue() { - return maximumValue; + return _maximumValue; } public int getInt() { @@ -89,20 +91,20 @@ public int getInt(String instanceName, PropertyMap props) { int n; boolean ok = true; - String value = props.getProperty(getPropertyName(), String.valueOf(defaultValue)); + String value = props.getProperty(_propertyName, String.valueOf(_defaultValue)); try { n = Integer.parseInt(value); } catch (NumberFormatException ex) { ok = false; n = 0; } - if (n < minimumValue || n > maximumValue) { + if (n < _minimumValue || n > _maximumValue) { ok = false; } if (!ok) { - badPropertyValue(instanceName, value, expectedNumberInRange(minimumValue, maximumValue)); + badPropertyValue(instanceName, value, expectedNumberInRange(_minimumValue, _maximumValue)); } - logPropertyValue(instanceName, value, n == defaultValue); + logPropertyValue(instanceName, value, n == _defaultValue); return n; } } Modified: geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/properties/LongProperty.java URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/properties/LongProperty.java?view=diff&r1=158861&r2=158862 ============================================================================== --- geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/properties/LongProperty.java (original) +++ geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/properties/LongProperty.java Wed Mar 23 18:30:30 2005 @@ -17,10 +17,15 @@ */ package org.apache.geronimo.interop.properties; + + + public class LongProperty extends PropertyType { - private long defaultValue = 0; - private long minimumValue = 0; - private long maximumValue = Integer.MAX_VALUE; + private long _defaultValue = 0; + + private long _minimumValue = 0; + + private long _maximumValue = Integer.MAX_VALUE; public LongProperty(Class componentClass, String propertyName) { super(componentClass, propertyName); @@ -52,57 +57,65 @@ } public LongProperty defaultValue(long defaultValue) { - this.defaultValue = defaultValue; + _defaultValue = defaultValue; return this; } public LongProperty minimumValue(long minimumValue) { - this.minimumValue = minimumValue; + _minimumValue = minimumValue; return this; } public LongProperty maximumValue(long maximumValue) { - this.maximumValue = maximumValue; + _maximumValue = maximumValue; return this; } public long getDefaultValue() { - return defaultValue; + return _defaultValue; } public String getDefaultValueAsString() { - return String.valueOf(defaultValue); + return String.valueOf(_defaultValue); } public long getMinimumValue() { - return minimumValue; + return _minimumValue; } public long getMaximumValue() { - return maximumValue; + return _maximumValue; } public long getLong() { return getLong(null, getComponentProperties()); } + /* + public long getLong(Object instance) + { + return getLong(((Component.InstanceName)instance).getInstanceName(), + ((Component.InstanceProperties)instance).getInstanceProperties()); + } + */ + public long getLong(String instanceName, PropertyMap props) { long n; boolean ok = true; - String value = props.getProperty(getPropertyName(), String.valueOf(defaultValue)); + String value = props.getProperty(_propertyName, String.valueOf(_defaultValue)); try { n = Long.parseLong(value); } catch (NumberFormatException ex) { ok = false; n = 0; } - if (n < minimumValue || n > maximumValue) { + if (n < _minimumValue || n > _maximumValue) { ok = false; } if (!ok) { - badPropertyValue(instanceName, value, expectedNumberInRange(minimumValue, maximumValue)); + badPropertyValue(instanceName, value, expectedNumberInRange(_minimumValue, _maximumValue)); } - logPropertyValue(instanceName, value, n == defaultValue); + logPropertyValue(instanceName, value, n == _defaultValue); return n; } } Modified: geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/properties/PropertyLog.java URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/properties/PropertyLog.java?view=diff&r1=158861&r2=158862 ============================================================================== --- geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/properties/PropertyLog.java (original) +++ geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/properties/PropertyLog.java Wed Mar 23 18:30:30 2005 @@ -24,14 +24,14 @@ return log; } - private String instanceName; + private String _instanceName; public String getInstanceName() { - return instanceName; + return _instanceName; } protected void init(String instanceName) { - this.instanceName = instanceName; + _instanceName = instanceName; } public void debugUsingValue(String value) { Modified: geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/properties/PropertyType.java URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/properties/PropertyType.java?view=diff&r1=158861&r2=158862 ============================================================================== --- geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/properties/PropertyType.java (original) +++ geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/properties/PropertyType.java Wed Mar 23 18:30:30 2005 @@ -21,38 +21,46 @@ import org.apache.geronimo.interop.util.ExceptionUtil; + public abstract class PropertyType { - protected static boolean debug; + protected static boolean _debug; static { try { - debug = Boolean.getBoolean("org.apache.geronimo.interop.debug:properties"); + _debug = Boolean.getBoolean("org.apache.geronimo.interop.debug:properties"); } catch (Exception ignore) // e.g. SecurityException for Applet { - debug = false; + _debug = false; } } - private Class componentClass; - private String propertyName; - private String displayName; - private String displayOnlyIfOther; - private String displayOnlyIfValue; - private String description; - private String consoleHelp; - private int sortOrder; + protected Class _componentClass; + + protected String _propertyName; + + protected String _displayName; + + protected String _displayOnlyIfOther; + + protected String _displayOnlyIfValue; + + protected String _description; + + protected String _consoleHelp; + + protected int _sortOrder; public PropertyType(Class componentClass, String propertyName) { - this.componentClass = componentClass; - this.propertyName = propertyName; + _componentClass = componentClass; + _propertyName = propertyName; } public Class getComponentClass() { - return componentClass; + return _componentClass; } public PropertyMap getComponentProperties() { - if (componentClass == SystemProperties.class) { + if (_componentClass == SystemProperties.class) { return SystemProperties.getInstance(); } else { return null; // Component.forClass(_componentClass).getProperties(); @@ -60,31 +68,31 @@ } public String getPropertyName() { - return propertyName; + return _propertyName; } public String getDisplayName() { - return displayName; + return _displayName; } public String getDisplayOnlyIfOther() { - return displayOnlyIfOther; + return _displayOnlyIfOther; } public String getDisplayOnlyIfValue() { - return displayOnlyIfValue; + return _displayOnlyIfValue; } public String getDescription() { - return description; + return _description; } public String getConsoleHelp() { - return consoleHelp; + return _consoleHelp; } public int getSortOrder() { - return sortOrder; + return _sortOrder; } public String getDefaultValueAsString() { @@ -100,24 +108,24 @@ } public void setDisplayName(String displayName) { - this.displayName = displayName; + _displayName = displayName; } public void setDisplayOnlyIf(PropertyType other, String value) { - displayOnlyIfOther = other.getPropertyName(); - displayOnlyIfValue = value; + _displayOnlyIfOther = other.getPropertyName(); + _displayOnlyIfValue = value; } public void setDescription(String description) { - this.description = description; + _description = description; } public void setConsoleHelp(String consoleHelp) { - this.consoleHelp = consoleHelp; + _consoleHelp = consoleHelp; } public void setSortOrder(int sortOrder) { - this.sortOrder = sortOrder; + _sortOrder = sortOrder; } public void badPropertyValue(String instanceName, String value) { @@ -161,20 +169,20 @@ } public void logPropertyValue(String instanceName, String value, boolean usingDefaultValue) { - if (propertyName.toLowerCase().endsWith("password")) { + if (_propertyName.toLowerCase().endsWith("password")) { value = "******"; } - if (debug) // TODO: allow for bootstrap + if (_debug) // TODO: allow for bootstrap { if (usingDefaultValue) { - if (componentClass == SystemProperties.class) { - SystemPropertyLog.getInstance(propertyName).debugUsingDefaultValue(value); + if (_componentClass == SystemProperties.class) { + SystemPropertyLog.getInstance(_propertyName).debugUsingDefaultValue(value); } else { getLog(instanceName).debugUsingDefaultValue(value); } } else { - if (componentClass == SystemProperties.class) { - SystemPropertyLog.getInstance(propertyName).debugUsingValue(value); + if (_componentClass == SystemProperties.class) { + SystemPropertyLog.getInstance(_propertyName).debugUsingValue(value); } else { getLog(instanceName).debugUsingValue(value); } @@ -192,6 +200,6 @@ } public PropertyLog getLog(String instanceName) { - return PropertyLog.getInstance(propertyName + ", " + getContext(instanceName)); + return PropertyLog.getInstance(_propertyName + ", " + getContext(instanceName)); } } Modified: geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/properties/ShortProperty.java URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/properties/ShortProperty.java?view=diff&r1=158861&r2=158862 ============================================================================== --- geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/properties/ShortProperty.java (original) +++ geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/properties/ShortProperty.java Wed Mar 23 18:30:30 2005 @@ -18,9 +18,11 @@ package org.apache.geronimo.interop.properties; public class ShortProperty extends PropertyType { - private short defaultValue = 0; - private short minimumValue = 0; - private short maximumValue = Short.MAX_VALUE; + private short _defaultValue = 0; + + private short _minimumValue = 0; + + private short _maximumValue = Short.MAX_VALUE; public ShortProperty(Class componentClass, String propertyName) { super(componentClass, propertyName); @@ -52,34 +54,34 @@ } public ShortProperty defaultValue(short defaultValue) { - this.defaultValue = defaultValue; + _defaultValue = defaultValue; return this; } public ShortProperty minimumValue(short minimumValue) { - this.minimumValue = minimumValue; + _minimumValue = minimumValue; return this; } public ShortProperty maximumValue(short maximumValue) { - this.maximumValue = maximumValue; + _maximumValue = maximumValue; return this; } public short getDefaultValue() { - return defaultValue; + return _defaultValue; } public String getDefaultValueAsString() { - return String.valueOf(defaultValue); + return String.valueOf(_defaultValue); } public short getMinimumValue() { - return minimumValue; + return _minimumValue; } public short getMaximumValue() { - return maximumValue; + return _maximumValue; } public short getShort() { @@ -89,20 +91,20 @@ public short getShort(String instanceName, PropertyMap props) { short n; boolean ok = true; - String value = props.getProperty(getPropertyName(), String.valueOf(defaultValue)); + String value = props.getProperty(_propertyName, String.valueOf(_defaultValue)); try { n = Short.parseShort(value); } catch (NumberFormatException ex) { ok = false; n = 0; } - if (n < minimumValue || n > maximumValue) { + if (n < _minimumValue || n > _maximumValue) { ok = false; } if (!ok) { - badPropertyValue(instanceName, value, expectedNumberInRange(minimumValue, maximumValue)); + badPropertyValue(instanceName, value, expectedNumberInRange(_minimumValue, _maximumValue)); } - logPropertyValue(instanceName, value, n == defaultValue); + logPropertyValue(instanceName, value, n == _defaultValue); return n; } } Modified: geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/properties/StringProperty.java URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/properties/StringProperty.java?view=diff&r1=158861&r2=158862 ============================================================================== --- geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/properties/StringProperty.java (original) +++ geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/properties/StringProperty.java Wed Mar 23 18:30:30 2005 @@ -28,16 +28,25 @@ import org.apache.geronimo.interop.util.ListUtil; import org.apache.geronimo.interop.util.StringUtil; + public class StringProperty extends PropertyType { - private String defaultValue = ""; - private List valueIsInList = null; - private Map displayValues = null; - private Class valueIsNameOf = null; - private boolean isDirName = false; - private boolean isFileName = false; - private boolean isList = false; - private boolean isReadOnly = false; - private boolean isRequired = false; + private String _defaultValue = ""; + + private List _valueIsInList = null; + + private Map _displayValues = null; + + private Class _valueIsNameOf = null; + + private boolean _isDirName = false; + + private boolean _isFileName = false; + + private boolean _isList = false; + + private boolean _isReadOnly = false; + + private boolean _isRequired = false; public StringProperty(Class componentClass, String propertyName) { super(componentClass, propertyName); @@ -69,41 +78,41 @@ } public StringProperty defaultValue(String defaultValue) { - this.defaultValue = defaultValue; + _defaultValue = defaultValue; return this; } public StringProperty legalValues(Class valueIsNameOf) { - this.valueIsNameOf = valueIsNameOf; + _valueIsNameOf = valueIsNameOf; return this; } public StringProperty legalValues(List valueIsInList) { - valueIsInList = Collections.unmodifiableList(valueIsInList); + _valueIsInList = Collections.unmodifiableList(valueIsInList); return this; } public StringProperty legalValues(String valueIsInList) { List list = ListUtil.getCommaSeparatedList(valueIsInList); - this.valueIsInList = new ArrayList(list.size()); + _valueIsInList = new ArrayList(list.size()); for (Iterator i = list.iterator(); i.hasNext();) { String value = (String) i.next(); if (value.indexOf('=') != -1) { String displayValue = StringUtil.afterFirst("=", value).trim(); value = StringUtil.beforeFirst("=", value).trim(); - if (displayValues == null) { - displayValues = new HashMap(); + if (_displayValues == null) { + _displayValues = new HashMap(); } - displayValues.put(value, displayValue); + _displayValues.put(value, displayValue); } - this.valueIsInList.add(value); + _valueIsInList.add(value); } return this; } public String getDisplayValue(String value) { - if (displayValues != null) { - String displayValue = (String) displayValues.get(value); + if (_displayValues != null) { + String displayValue = (String) _displayValues.get(value); if (displayValue != null) { return displayValue; } @@ -112,54 +121,54 @@ } public StringProperty isDirName() { - isDirName = true; + _isDirName = true; return this; } public StringProperty isFileName() { - isFileName = true; + _isFileName = true; return this; } public StringProperty list() { - isList = true; + _isList = true; return this; } public StringProperty readOnly() { - isReadOnly = true; + _isReadOnly = true; return this; } public StringProperty required() { - isRequired = true; + _isRequired = true; return this; } public boolean isList() { - return isList; + return _isList; } public boolean isReadOnly() { - return isReadOnly; + return _isReadOnly; } public boolean isRequired() { - return isRequired; + return _isRequired; } public String getDefaultValue() { - return defaultValue; + return _defaultValue; } public String getDefaultValueAsString() { - return defaultValue; + return _defaultValue; } public List getLegalValues() { - if (valueIsInList != null) { - return valueIsInList; - } else if (valueIsNameOf != null) { + if (_valueIsInList != null) { + return _valueIsInList; + } else if (_valueIsNameOf != null) { //return Repository.getInstance().getInstanceNames(_valueIsNameOf); return null; } else { @@ -173,7 +182,7 @@ public String getString(String instanceName, PropertyMap props) { boolean ok = true, usingDefaultValue = false; - String s = props.getProperty(getPropertyName(), defaultValue); + String s = props.getProperty(_propertyName, _defaultValue); if (s != null && s.startsWith("${")) { // Value is contained in system property. s = StringUtil.removePrefix(s, "${"); @@ -182,7 +191,7 @@ s = sp.getString(); if (s == null || s.length() == 0) { if (isRequired()) { - String message = getLog(instanceName).errorMissingValueForRequiredSystemProperty(sp.getPropertyName(), getPropertyName(), getContext(instanceName)); + String message = getLog(instanceName).errorMissingValueForRequiredSystemProperty(sp.getPropertyName(), _propertyName, getContext(instanceName)); throw new MissingRequiredPropertyException(message); } } @@ -207,17 +216,17 @@ if (!ok) { badPropertyValue(instanceName, s, expectedValueInList(legalValues)); } - if (isDirName || isFileName) { + if (_isDirName || _isFileName) { s = FileUtil.expandHomeRelativePath(s); s = FileUtil.pretty(s); } if (s == null || s.length() == 0) { if (isRequired()) { - String message = getLog(instanceName).errorMissingValueForRequiredProperty(getPropertyName(), getContext(instanceName)); + String message = getLog(instanceName).errorMissingValueForRequiredProperty(_propertyName, getContext(instanceName)); throw new MissingRequiredPropertyException(message); } } - logPropertyValue(instanceName, s, s != null && s.equals(defaultValue)); + logPropertyValue(instanceName, s, s != null && s.equals(_defaultValue)); return s; } } Modified: geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/properties/SystemProperties.java URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/properties/SystemProperties.java?view=diff&r1=158861&r2=158862 ============================================================================== --- geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/properties/SystemProperties.java (original) +++ geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/properties/SystemProperties.java Wed Mar 23 18:30:30 2005 @@ -68,23 +68,23 @@ // privata data - private static SystemProperties instance; - private boolean canAccessFileSystem = true; - private boolean rmiTrace; - private boolean debug; - private boolean quiet; - private boolean verbose; - private String home; - private String repository; - private String tempDir; + private static SystemProperties _instance; + private boolean _canAccessFileSystem = true; + private boolean _rmiTrace; + private boolean _debug; + private boolean _quiet; + private boolean _verbose; + private String _home; + private String _repository; + private String _tempDir; static { - instance = new SystemProperties(); - instance.init(); + _instance = new SystemProperties(); + _instance.init(); } public static SystemProperties getInstance() { - return instance; + return _instance; } // private methods @@ -94,52 +94,52 @@ putAll(System.getProperties()); } catch (Exception ignore) // e.g. due to Applet Security Manager { - canAccessFileSystem = false; + _canAccessFileSystem = false; } } private void init() { - debug = debugProperty.getBoolean(); - quiet = quietProperty.getBoolean(); - verbose = verboseProperty.getBoolean(); + _debug = debugProperty.getBoolean(); + _quiet = quietProperty.getBoolean(); + _verbose = verboseProperty.getBoolean(); - if (verbose) { - System.out.println("System Property org.apache.geronimo.interop.debug = " + debug); + if (_verbose) { + System.out.println("System Property org.apache.geronimo.interop.debug = " + _debug); System.out.println("System Property org.apache.geronimo.interop.verbose = true"); } - rmiTrace = rmiTraceProperty.getBoolean(); + _rmiTrace = rmiTraceProperty.getBoolean(); homeProperty.defaultValue("/org.apache.geronimo.interop"); - home = homeProperty.getString(); + _home = homeProperty.getString(); - repositoryProperty.defaultValue(home + "/Repository"); - repository = repositoryProperty.getString(); + repositoryProperty.defaultValue(_home + "/Repository"); + _repository = repositoryProperty.getString(); - tempDirProperty.defaultValue(home + "/temp"); - tempDir = tempDirProperty.getString(); + tempDirProperty.defaultValue(_home + "/temp"); + _tempDir = tempDirProperty.getString(); } // public methods public static boolean rmiTrace() { - return getInstance().rmiTrace; + return getInstance()._rmiTrace; } public static boolean debug() { - return getInstance().debug; + return getInstance()._debug; } public static boolean quiet() { - return getInstance().quiet; + return getInstance()._quiet; } public static boolean verbose() { - return getInstance().verbose; + return getInstance()._verbose; } public static boolean canAccessFileSystem() { - return getInstance().canAccessFileSystem; + return getInstance()._canAccessFileSystem; } public static String logFile() { @@ -156,14 +156,14 @@ } public static String getHome() { - return getInstance().home; + return getInstance()._home; } public static String getRepository() { - return getInstance().repository; + return getInstance()._repository; } public static String getTempDir() { - return getInstance().tempDir; + return getInstance()._tempDir; } } Modified: geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/properties/SystemPropertyLog.java URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/properties/SystemPropertyLog.java?view=diff&r1=158861&r2=158862 ============================================================================== --- geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/properties/SystemPropertyLog.java (original) +++ geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/properties/SystemPropertyLog.java Wed Mar 23 18:30:30 2005 @@ -17,6 +17,9 @@ */ package org.apache.geronimo.interop.properties; + + + public class SystemPropertyLog { public static SystemPropertyLog getInstance(String instanceName) { SystemPropertyLog log = new SystemPropertyLog(); @@ -24,15 +27,31 @@ return log; } - private String instanceName; + // ----------------------------------------------------------------------- + // private data + // ----------------------------------------------------------------------- + + private String _instanceName; + + // ----------------------------------------------------------------------- + // public methods + // ----------------------------------------------------------------------- public String getInstanceName() { - return instanceName; + return _instanceName; } + // ----------------------------------------------------------------------- + // protected methods + // ----------------------------------------------------------------------- + protected void init(String instanceName) { - instanceName = instanceName; + _instanceName = instanceName; } + + // ----------------------------------------------------------------------- + // log methods + // ----------------------------------------------------------------------- public void debugUsingValue(String value) { System.out.println("SystemPropertyLog.debugUsingValue(): value: " + value); Modified: geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/repository/Repository.java URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/repository/Repository.java?view=diff&r1=158861&r2=158862 ============================================================================== --- geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/repository/Repository.java (original) +++ geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/repository/Repository.java Wed Mar 23 18:30:30 2005 @@ -0,0 +1,23 @@ +/** + * + * Copyright 2004-2005 The Apache Software Foundation + * + * Licensed 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.geronimo.interop.repository; + + +public class Repository { + // ?? +} Modified: geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/rmi/iiop/Any.java URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/rmi/iiop/Any.java?view=diff&r1=158861&r2=158862 ============================================================================== --- geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/rmi/iiop/Any.java (original) +++ geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/rmi/iiop/Any.java Wed Mar 23 18:30:30 2005 @@ -19,85 +19,51 @@ import org.omg.CORBA.TCKind; + /** - * * An implementation of CORBA 'any'. + * * An implementation of CORBA 'any' for the Sybase ORB. */ -public class Any - extends org.omg.CORBA.Any -{ +public class Any extends org.omg.CORBA.Any { private org.omg.CORBA.TypeCode _type; private byte[] _data; - /** - * @param tk - * @param what - */ - private void extract_type(TCKind tk, String what) - { - if (_type.kind().value() != tk.value()) - { + private void extract_type(TCKind tk, String what) { + if (_type.kind().value() != tk.value()) { throw new org.omg.CORBA.BAD_TYPECODE("com.sybase.CORBA.Any.extract_" - + what + ": type = " + _type); + + what + ": type = " + _type); } } - /** - * - */ - public Any() - { + public Any() { _type = TypeCode.NULL; } - /** - * @param a - * @return - */ - public boolean equal(org.omg.CORBA.Any a) - { - if (!_type.equal(a.type())) - { + public boolean equal(org.omg.CORBA.Any a) { + if (!_type.equal(a.type())) { return false; } - if (a instanceof org.apache.geronimo.interop.rmi.iiop.Any) - { + if (a instanceof org.apache.geronimo.interop.rmi.iiop.Any) { org.apache.geronimo.interop.rmi.iiop.Any _that = (org.apache.geronimo.interop.rmi.iiop.Any) a; String x = org.apache.geronimo.interop.util.Base16Binary.toString(this._data); String y = org.apache.geronimo.interop.util.Base16Binary.toString(_that._data); return x.equals(y); - } - else - { + } else { // TODO: implement equality testing with other ORB's 'any' values throw new org.omg.CORBA.NO_IMPLEMENT("org.apache.geronimo.interop.rmi.iiop.Any.equal(" - + a.getClass().getName() + ")"); + + a.getClass().getName() + ")"); } } - /** - * @return - */ - public org.omg.CORBA.TypeCode type() - { + public org.omg.CORBA.TypeCode type() { return _type; } - /** - * @param type - */ - public void type(org.omg.CORBA.TypeCode type) - { + public void type(org.omg.CORBA.TypeCode type) { _type = type; } - /** - * @param input - * @param type - */ - public void read_value(org.omg.CORBA.portable.InputStream input, - org.omg.CORBA.TypeCode type) - { + public void read_value(org.omg.CORBA.portable.InputStream input, org.omg.CORBA.TypeCode type) { byte[] buffer = ((CdrInputStream) input)._buffer; int length = ((CdrInputStream) input)._length; _type = type; @@ -105,431 +71,247 @@ System.arraycopy(buffer, 0, _data, 0, length); } - /** - * @param output - */ - public void write_value(org.omg.CORBA.portable.OutputStream output) - { + public void write_value(org.omg.CORBA.portable.OutputStream output) { // A no-op in this implementation. } - /** - * @return - */ - public org.omg.CORBA.portable.OutputStream create_output_stream() - { + public org.omg.CORBA.portable.OutputStream create_output_stream() { _data = null; return CdrOutputStream.getInstance(); } - /** - * @return - */ - public org.omg.CORBA.portable.InputStream create_input_stream() - { - if (_data == null) - { - throw new org.omg.CORBA.BAD_OPERATION( - "com.sybase.CORBA.Any.create_input_stream"); + public org.omg.CORBA.portable.InputStream create_input_stream() { + if (_data == null) { + throw new org.omg.CORBA.BAD_OPERATION("com.sybase.CORBA.Any.create_input_stream"); } return CdrInputStream.getInstance(); } - /** - * @return - */ - public short extract_short() - { + public short extract_short() { extract_type(TCKind.tk_short, "short"); return create_input_stream().read_short(); } - /** - * @param value - */ - public void insert_short(short value) - { + public void insert_short(short value) { org.omg.CORBA.portable.OutputStream output = create_output_stream(); output.write_short(value); read_value(null, TypeCode.SHORT); } - /** - * @return - */ - public int extract_long() - { + public int extract_long() { extract_type(TCKind.tk_long, "long"); return create_input_stream().read_long(); } - /** - * @param value - */ - public void insert_long(int value) - { + public void insert_long(int value) { org.omg.CORBA.portable.OutputStream output = create_output_stream(); output.write_long(value); read_value(null, TypeCode.LONG); } - /** - * @return - */ - public long extract_longlong() - { + public long extract_longlong() { extract_type(TCKind.tk_longlong, "longlong"); return create_input_stream().read_longlong(); } - /** - * @param value - */ - public void insert_longlong(long value) - { + public void insert_longlong(long value) { org.omg.CORBA.portable.OutputStream output = create_output_stream(); output.write_longlong(value); read_value(null, TypeCode.LONGLONG); } - /** - * @return - */ - public short extract_ushort() - { + public short extract_ushort() { extract_type(TCKind.tk_ushort, "ushort"); return create_input_stream().read_ushort(); } - /** - * @param value - */ - public void insert_ushort(short value) - { + public void insert_ushort(short value) { org.omg.CORBA.portable.OutputStream output = create_output_stream(); output.write_ushort(value); read_value(null, TypeCode.USHORT); } - /** - * @return - */ - public int extract_ulong() - { + public int extract_ulong() { extract_type(TCKind.tk_ulong, "ulong"); return create_input_stream().read_ulong(); } - /** - * @param value - */ - public void insert_ulong(int value) - { + public void insert_ulong(int value) { org.omg.CORBA.portable.OutputStream output = create_output_stream(); output.write_ulong(value); read_value(null, TypeCode.ULONG); } - /** - * @return - */ - public long extract_ulonglong() - { + public long extract_ulonglong() { extract_type(TCKind.tk_ulonglong, "ulonglong"); return create_input_stream().read_ulonglong(); } - /** - * @param value - */ - public void insert_ulonglong(long value) - { + public void insert_ulonglong(long value) { org.omg.CORBA.portable.OutputStream output = create_output_stream(); output.write_ulonglong(value); read_value(null, TypeCode.ULONGLONG); } - /** - * @return - */ - public float extract_float() - { + public float extract_float() { extract_type(TCKind.tk_float, "float"); return create_input_stream().read_float(); } - /** - * @param value - */ - public void insert_float(float value) - { + public void insert_float(float value) { org.omg.CORBA.portable.OutputStream output = create_output_stream(); output.write_float(value); read_value(null, TypeCode.FLOAT); } - /** - * @return - */ - public double extract_double() - { + public double extract_double() { extract_type(TCKind.tk_double, "double"); return create_input_stream().read_double(); } - /** - * @param value - */ - public void insert_double(double value) - { + public void insert_double(double value) { org.omg.CORBA.portable.OutputStream output = create_output_stream(); output.write_double(value); read_value(null, TypeCode.DOUBLE); } - /** - * @return - */ - public boolean extract_boolean() - { + public boolean extract_boolean() { extract_type(TCKind.tk_boolean, "boolean"); return create_input_stream().read_boolean(); } - /** - * @param value - */ - public void insert_boolean(boolean value) - { + public void insert_boolean(boolean value) { org.omg.CORBA.portable.OutputStream output = create_output_stream(); output.write_boolean(value); read_value(null, TypeCode.BOOLEAN); } - /** - * @return - */ - public char extract_char() - { + public char extract_char() { extract_type(TCKind.tk_char, "char"); return create_input_stream().read_char(); } - /** - * @param value - */ - public void insert_char(char value) - { + public void insert_char(char value) { org.omg.CORBA.portable.OutputStream output = create_output_stream(); output.write_char(value); read_value(null, TypeCode.CHAR); } - /** - * @return - */ - public char extract_wchar() - { + public char extract_wchar() { extract_type(TCKind.tk_wchar, "wchar"); return create_input_stream().read_wchar(); } - /** - * @param value - */ - public void insert_wchar(char value) - { + public void insert_wchar(char value) { org.omg.CORBA.portable.OutputStream output = create_output_stream(); output.write_wchar(value); read_value(null, TypeCode.WCHAR); } - /** - * @return - */ - public byte extract_octet() - { + public byte extract_octet() { extract_type(TCKind.tk_octet, "octet"); return create_input_stream().read_octet(); } - /** - * @param value - */ - public void insert_octet(byte value) - { + public void insert_octet(byte value) { org.omg.CORBA.portable.OutputStream output = create_output_stream(); output.write_octet(value); read_value(null, TypeCode.OCTET); } - /** - * @return - */ - public org.omg.CORBA.Any extract_any() - { + public org.omg.CORBA.Any extract_any() { extract_type(TCKind.tk_any, "any"); return create_input_stream().read_any(); } - /** - * @param value - */ - public void insert_any(org.omg.CORBA.Any value) - { + public void insert_any(org.omg.CORBA.Any value) { org.omg.CORBA.portable.OutputStream output = create_output_stream(); output.write_any(value); read_value(null, TypeCode.ANY); } - /** - * @return - */ - public org.omg.CORBA.Object extract_Object() - { + public org.omg.CORBA.Object extract_Object() { extract_type(TCKind.tk_objref, "Object"); org.omg.CORBA.Object obj = create_input_stream().read_Object(); return obj; } - /** - * @param value - */ - public void insert_Object(org.omg.CORBA.Object value) - { + public void insert_Object(org.omg.CORBA.Object value) { org.omg.CORBA.portable.OutputStream output = create_output_stream(); output.write_Object(value); read_value(null, TypeCode.OBJREF); } - /** - * @param value - * @param type - */ - public void insert_Object(org.omg.CORBA.Object value, - org.omg.CORBA.TypeCode type) - { + public void insert_Object(org.omg.CORBA.Object value, org.omg.CORBA.TypeCode type) { org.omg.CORBA.portable.OutputStream output = create_output_stream(); output.write_Object(value); read_value(null, type); } - /** - * @return - */ - public java.io.Serializable extract_Value() - { + public java.io.Serializable extract_Value() { throw new org.omg.CORBA.NO_IMPLEMENT(); } - /** - * @param v - */ - public void insert_Value(java.io.Serializable v) - { + public void insert_Value(java.io.Serializable v) { throw new org.omg.CORBA.NO_IMPLEMENT(); } - /** - * @param v - * @param t - */ - public void insert_Value(java.io.Serializable v, org.omg.CORBA.TypeCode t) - { + public void insert_Value(java.io.Serializable v, org.omg.CORBA.TypeCode t) { throw new org.omg.CORBA.NO_IMPLEMENT(); } - /** - * @return - */ - public String extract_string() - { + public String extract_string() { extract_type(TCKind.tk_string, "string"); return create_input_stream().read_string(); } - /** - * @param value - */ - public void insert_string(String value) - { + public void insert_string(String value) { org.omg.CORBA.portable.OutputStream output = create_output_stream(); output.write_string(value); read_value(null, TypeCode.STRING); } - /** - * @return - */ - public String extract_wstring() - { + public String extract_wstring() { extract_type(TCKind.tk_wstring, "wstring"); return create_input_stream().read_wstring(); } - /** - * @param value - */ - public void insert_wstring(String value) - { + public void insert_wstring(String value) { org.omg.CORBA.portable.OutputStream output = create_output_stream(); output.write_wstring(value); read_value(null, TypeCode.WSTRING); } - /** - * @return - */ - public org.omg.CORBA.TypeCode extract_TypeCode() - { + public org.omg.CORBA.TypeCode extract_TypeCode() { extract_type(TCKind.tk_TypeCode, "TypeCode"); return create_input_stream().read_TypeCode(); } - /** - * @param value - */ - public void insert_TypeCode(org.omg.CORBA.TypeCode value) - { + public void insert_TypeCode(org.omg.CORBA.TypeCode value) { org.omg.CORBA.portable.OutputStream output = create_output_stream(); output.write_TypeCode(value); read_value(null, TypeCode.TYPECODE); } - /** - * @return - */ - public org.omg.CORBA.Principal extract_Principal() - { - throw new org.omg.CORBA.NO_IMPLEMENT( - "org.apache.geronimo.interop.rmi.iiop.Any.extract_Principal"); + public org.omg.CORBA.Principal extract_Principal() { + throw new org.omg.CORBA.NO_IMPLEMENT("org.apache.geronimo.interop.rmi.iiop.Any.extract_Principal"); } - public void insert_Principal(org.omg.CORBA.Principal value) - { - throw new org.omg.CORBA.NO_IMPLEMENT( - "org.apache.geronimo.interop.rmi.iiop.Any.insert_Principal"); + public void insert_Principal(org.omg.CORBA.Principal value) { + throw new org.omg.CORBA.NO_IMPLEMENT("org.apache.geronimo.interop.rmi.iiop.Any.insert_Principal"); } // Don't implement insert_Streamable and extract_Streamable since from // a TypeCode it appears to be impossible to determine the holder class // name (in the general case) in order to construct a Streamable object // for return from extract_Streamable. - /** - * @return - * @throws org.omg.CORBA.BAD_INV_ORDER - */ + public org.omg.CORBA.portable.Streamable extract_Streamable() - throws org.omg.CORBA.BAD_INV_ORDER - { + throws org.omg.CORBA.BAD_INV_ORDER { throw new org.omg.CORBA.NO_IMPLEMENT(); } - /** - * @param s - */ - public void insert_Streamable(org.omg.CORBA.portable.Streamable s) - { + public void insert_Streamable(org.omg.CORBA.portable.Streamable s) { throw new org.omg.CORBA.NO_IMPLEMENT(); } @@ -541,28 +323,16 @@ * * Construct an Any from a TypeCode and a String value * * (supported for boolean and numeric primitive IDL types only). */ - /** - * @param type - * @param value - */ - public Any(org.omg.CORBA.TypeCode type, String value) - { - try - { + public Any(org.omg.CORBA.TypeCode type, String value) { + try { _type = type; - switch (_type.kind().value()) - { + switch (_type.kind().value()) { case TCKind._tk_boolean: - if (value.equals("0")) - { + if (value.equals("0")) { insert_boolean(false); - } - else if (value.equals("1")) - { + } else if (value.equals("1")) { insert_boolean(true); - } - else - { + } else { insert_boolean(Boolean.valueOf(value).booleanValue()); } break; @@ -601,40 +371,22 @@ default: throw new org.omg.CORBA.BAD_PARAM(value); } - } - catch (NumberFormatException nfe) - { + } catch (NumberFormatException nfe) { throw new org.omg.CORBA.BAD_PARAM(value + " - " + nfe.toString()); } } - /** - * @param value - * @param min - * @param max - * @return - * @throws NumberFormatException - */ - private long parse(String value, long min, long max) - throws NumberFormatException - { + private long parse(String value, long min, long max) throws NumberFormatException { long n = Long.parseLong(value); - if (n < min || n > max) - { - throw new NumberFormatException(value + - " is not in range [" - + min + ".." + max + "]"); + if (n < min || n > max) { + throw new NumberFormatException(value + " is not in range [" + + min + ".." + max + "]"); } return n; } - /** - * @return - */ - public String toString() - { - switch (_type.kind().value()) - { + public String toString() { + switch (_type.kind().value()) { case TCKind._tk_any: case TCKind._tk_boolean: case TCKind._tk_char: @@ -658,13 +410,8 @@ } } - /** - * @return - */ - private String value() - { - switch (_type.kind().value()) - { + private String value() { + switch (_type.kind().value()) { case TCKind._tk_any: return "" + extract_any(); case TCKind._tk_boolean: Modified: geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/rmi/iiop/ArrayHelper.java URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/rmi/iiop/ArrayHelper.java?view=diff&r1=158861&r2=158862 ============================================================================== --- geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/rmi/iiop/ArrayHelper.java (original) +++ geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/rmi/iiop/ArrayHelper.java Wed Mar 23 18:30:30 2005 @@ -17,61 +17,42 @@ */ package org.apache.geronimo.interop.rmi.iiop; +import java.lang.reflect.Array; + +import org.apache.geronimo.interop.SystemException; import org.apache.geronimo.interop.util.ArrayUtil; -import java.lang.reflect.*; -public class ArrayHelper implements ObjectHelper -{ +public class ArrayHelper implements ObjectHelper { private ValueType _element; - private ObjectHelper _primitive; - - public ArrayHelper(Class elementClass) - { - if (elementClass.isPrimitive()) - { - _primitive = PrimitiveType.getArrayHelper(elementClass); - } - else - { + public ArrayHelper(Class elementClass) { + if (elementClass.isPrimitive()) { + throw new SystemException("TODO"); + } else { _element = ValueType.getInstance(elementClass); } } - public Object read(ObjectInputStream input) - { - if (_primitive != null) - { - return _primitive.read(input); - } + public Object read(ObjectInputStream input) { CdrInputStream cdrInput = input._cdrInput; int n = cdrInput.read_long(); - Object[] array = (Object[])Array.newInstance(_element._class, n); - for (int i = 0; i < n; i++) - { + Object[] array = (Object[]) Array.newInstance(_element._class, n); + for (int i = 0; i < n; i++) { array[i] = input.readObject(_element); } return array; } - public void write(ObjectOutputStream output, Object value) - { - if (_primitive != null) - { - _primitive.write(output, value); - return; - } + public void write(ObjectOutputStream output, Object value) { CdrOutputStream cdrOutput = output._cdrOutput; - Object[] array = (Object[])value; - if (array == null) - { + Object[] array = (Object[]) value; + if (array == null) { array = ArrayUtil.EMPTY_OBJECT_ARRAY; } int n = array.length; cdrOutput.write_long(n); - for (int i = 0; i < n; i++) - { + for (int i = 0; i < n; i++) { output.writeObject(_element, array[i]); } } Modified: geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/rmi/iiop/BadMagicException.java URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/rmi/iiop/BadMagicException.java?view=diff&r1=158861&r2=158862 ============================================================================== --- geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/rmi/iiop/BadMagicException.java (original) +++ geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/rmi/iiop/BadMagicException.java Wed Mar 23 18:30:30 2005 @@ -17,10 +17,8 @@ */ package org.apache.geronimo.interop.rmi.iiop; -public class BadMagicException extends RuntimeException -{ - public BadMagicException(String magic) - { +public class BadMagicException extends RuntimeException { + public BadMagicException(String magic) { super(magic); } }