Modified: geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JTryCatchFinallyStatement.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JTryCatchFinallyStatement.java?view=diff&r1=158813&r2=158814
==============================================================================
--- geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JTryCatchFinallyStatement.java (original)
+++ geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JTryCatchFinallyStatement.java Wed Mar 23 09:56:34 2005
@@ -19,32 +19,31 @@
import java.util.Vector;
-
public class JTryCatchFinallyStatement extends JStatement {
- protected JTryStatement _TryStatement;
- protected Vector _catchStatements;
- protected JFinallyStatement _FinallyStatement;
+ private JTryStatement tryStatement;
+ private Vector catchStatements;
+ private JFinallyStatement finallyStatement;
public JTryCatchFinallyStatement() {
- _TryStatement = new JTryStatement();
- _catchStatements = new Vector();
- _FinallyStatement = new JFinallyStatement();
+ tryStatement = new JTryStatement();
+ catchStatements = new Vector();
+ finallyStatement = new JFinallyStatement();
}
public void addTryStatement(JStatement s) {
- _TryStatement.addStatement(s);
+ tryStatement.addStatement(s);
}
public JTryStatement getTryStatement() {
- return _TryStatement;
+ return tryStatement;
}
public JCatchStatement getCatch(JVariable v) {
JCatchStatement rc = null;
- int index = _catchStatements.indexOf(v);
+ int index = catchStatements.indexOf(v);
if (index >= 0) {
- rc = (JCatchStatement) _catchStatements.get(index);
+ rc = (JCatchStatement) catchStatements.get(index);
}
return rc;
@@ -55,7 +54,7 @@
if (rc == null) {
rc = new JCatchStatement(v);
- _catchStatements.add(rc);
+ catchStatements.add(rc);
}
return rc;
@@ -72,14 +71,14 @@
}
public Vector getCatches() {
- return _catchStatements;
+ return catchStatements;
}
public void addFinallyStatement(JStatement s) {
- _FinallyStatement.addStatement(s);
+ finallyStatement.addStatement(s);
}
public JFinallyStatement getFinallyStatement() {
- return _FinallyStatement;
+ return finallyStatement;
}
}
Modified: geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JTryStatement.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JTryStatement.java?view=diff&r1=158813&r2=158814
==============================================================================
--- geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JTryStatement.java (original)
+++ geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JTryStatement.java Wed Mar 23 09:56:34 2005
@@ -22,33 +22,3 @@
super();
}
}
-
-/*
-public class JTryStatement extends JStatement
-{
- protected JBlockStatement _tryStatements;
-
- public JTryStatement( )
- {
- _tryStatements = new JBlockStatement();
- }
-
- public void addStatement( JStatement s )
- {
- if (s == _tryStatements ||
- s.equals( _tryStatements ))
- {
- // Don't add it.
- // Todo: Throw an exception?
- return;
- }
-
- _tryStatements.addStatement( s );
- }
-
- public JBlockStatement getStatement()
- {
- return _tryStatements;
- }
-}
-*/
\ No newline at end of file
Modified: geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JVariable.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JVariable.java?view=diff&r1=158813&r2=158814
==============================================================================
--- geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JVariable.java (original)
+++ geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JVariable.java Wed Mar 23 09:56:34 2005
@@ -19,43 +19,30 @@
import java.util.HashMap;
-
-public class JVariable extends JEntity {
- protected static HashMap _typeMap = new HashMap(60);
-
- protected Class _type;
- protected String _typeDecl;
- protected JExpression _initExpr;
- protected boolean _isArray;
+public class JVariable extends JType {
+ private String name;
+ private JExpression initExpr;
public JVariable(Class type, String name) {
- super(name);
- setType(type);
- }
-
- public void setType(Class type) {
- _type = type;
- calculateTypeDecl();
- }
-
- public Class getType() {
- return _type;
+ super(type);
+ this.name = name;
}
- public String getTypeDecl() {
- return _typeDecl;
+ public String getName()
+ {
+ return name;
}
public void setInitExpression(JExpression initExpr) {
- _initExpr = initExpr;
+ this.initExpr = initExpr;
}
public JExpression getInitExpression() {
- return _initExpr;
+ return initExpr;
}
public int hashCode() {
- return _type.hashCode() + _name.hashCode();
+ return super.hashCode() + name.hashCode();
}
public boolean equals(Object other) {
@@ -66,66 +53,10 @@
} else if (other instanceof JVariable) {
JVariable v = (JVariable) other;
- rc = v._type.equals(_type);
- }
-
- return rc;
- }
-
- protected void calculateTypeDecl() {
- if (_type == null) {
- return;
- }
-
- _typeDecl = (String) _typeMap.get(_type);
-
- if (_typeDecl == null) {
- synchronized (_typeMap) {
- _typeDecl = _type.getName();
-
- if (_type.isArray()) {
- _typeDecl = convertToTypeDecl(_typeDecl);
- }
-
- _typeMap.put(_type, _typeDecl);
- }
- }
- }
-
- protected String convertToTypeDecl(String typeName) {
- String rc = "";
- char charAt = 0;
- int i;
-
- if (typeName != null && typeName.length() > 0) {
- for (i = 0; i < typeName.length(); i++) {
- charAt = typeName.charAt(i);
-
- if (charAt == '[') {
- rc = rc + "[]";
- } else if (charAt == 'Z') {
- rc = "boolean" + rc;
- } else if (charAt == 'B') {
- rc = "byte" + rc;
- } else if (charAt == 'C') {
- rc = "char" + rc;
- } else if (charAt == 'L') {
- int semiIndex = typeName.indexOf(";");
- rc = typeName.substring(i + 1, semiIndex) + rc;
- i = semiIndex;
- } else if (charAt == 'D') {
- rc = "double" + rc;
- } else if (charAt == 'F') {
- rc = "float" + rc;
- } else if (charAt == 'I') {
- rc = "int" + rc;
- } else if (charAt == 'J') {
- rc = "long" + rc;
- } else if (charAt == 'S') {
- rc = "short" + rc;
- } else {
- System.out.println("Error: Invalid signature. typeName = " + typeName + ", charAt = " + charAt + ", i = " + i);
- }
+ rc = super.equals(other);
+ if (rc)
+ {
+ v.getName().equals(name);
}
}
@@ -133,37 +64,8 @@
}
protected void showTypeInfo() {
- System.out.println("getName() = " + _type.getName());
- System.out.println("\tisArray() = " + _type.isArray());
- System.out.println("\tisPrimitive() = " + _type.isPrimitive());
- System.out.println("\ttoString() = " + _type.toString());
- System.out.println("\ttypeDecl = " + getTypeDecl());
- System.out.println("");
- }
-
- protected void validateDeclType(String t) {
- String ct = getTypeDecl();
- if (!t.equals(ct)) {
- System.out.println("Class Decl Type: '" + ct + "' does not match expected type: '" + t + "'");
- }
+ System.out.println("getName() = " + name);
+ super.showTypeInfo();
}
- public static void main(String args[])
- throws Exception {
- (new JVariable(java.lang.String.class, "v")).showTypeInfo();
- (new JVariable(java.lang.String[].class, "v")).showTypeInfo();
- (new JVariable(java.lang.String[][].class, "v")).showTypeInfo();
-
- (new JVariable(int.class, "v")).showTypeInfo();
- (new JVariable(int[].class, "v")).showTypeInfo();
- (new JVariable(int[][].class, "v")).showTypeInfo();
-
- (new JVariable(java.lang.String.class, "v")).validateDeclType("java.lang.String");
- (new JVariable(java.lang.String[].class, "v")).validateDeclType("java.lang.String[]");
- (new JVariable(java.lang.String[][].class, "v")).validateDeclType("java.lang.String[][]");
-
- (new JVariable(int.class, "v")).validateDeclType("int");
- (new JVariable(int[].class, "v")).validateDeclType("int[]");
- (new JVariable(int[][].class, "v")).validateDeclType("int[][]");
- }
}
Modified: geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JavaGenerator.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JavaGenerator.java?view=diff&r1=158813&r2=158814
==============================================================================
--- geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JavaGenerator.java (original)
+++ geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JavaGenerator.java Wed Mar 23 09:56:34 2005
@@ -21,20 +21,19 @@
import java.lang.reflect.Modifier;
import java.util.Vector;
-
public class JavaGenerator implements Generator {
- protected GenOptions _genOptions;
+ private GenOptions genOptions;
public JavaGenerator(GenOptions genOptions) {
- _genOptions = genOptions;
+ this.genOptions = genOptions;
}
public GenOptions getGenOptions() {
- return _genOptions;
+ return genOptions;
}
public void setGenOptions(GenOptions genOptions) {
- _genOptions = genOptions;
+ this.genOptions = genOptions;
}
public void generate(JEntity e) {
@@ -70,7 +69,7 @@
String fullName = pkgName + "/" + className;
- JavaWriter jw = new JavaWriter(_genOptions, fullName, ".java");
+ JavaWriter jw = new JavaWriter(genOptions, fullName, ".java");
jw.openFile();
writeClass(jw, c);
@@ -213,13 +212,7 @@
if (m instanceof JConstructor) {
jw.print(c.getName());
} else {
- //jw.print( m.getRCType() + " " + m.getName() );
- jw.print(m.getRT().getTypeName());
-
- if (m.getRT().isArray()) {
- jw.print("[]");
- }
-
+ jw.print(m.getRT().getTypeDecl());
jw.print(" " + m.getName());
}
jw.print("(");
Modified: geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JavaWriter.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JavaWriter.java?view=diff&r1=158813&r2=158814
==============================================================================
--- geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JavaWriter.java (original)
+++ geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JavaWriter.java Wed Mar 23 09:56:34 2005
@@ -23,16 +23,13 @@
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
-
public class JavaWriter extends CodeWriter {
- protected GenOptions _genOptions;
-
- protected PrintWriter _pw;
-
- protected boolean _needIndent = true;
- protected int _indentPos = 0;
- protected String _indentStr = "";
- protected String _spaces = " ";
+ private GenOptions genOptions;
+ private PrintWriter pw;
+ private boolean needIndent = true;
+ private int indentPos = 0;
+ private String indentStr = "";
+ private String spaces = " ";
public JavaWriter(GenOptions genOptions, String fileName, String ext) {
super(genOptions, fileName, ext);
@@ -45,15 +42,15 @@
String fileName = getFileName() + getFileExt();
try {
- file = new File(go.getGenDir(), fileName);
+ file = new File(go.getGenSrcDir(), fileName);
if (file.exists() && !go.isOverwrite()) {
fileName = fileName + ".new";
- file = new File(go.getGenDir(), fileName);
+ file = new File(go.getGenSrcDir(), fileName);
}
} catch (Exception ex) {
- throw new GenException("Error: Unable to open output dir: " + go.getGenDir() + ", file: " + fileName, ex);
+ throw new GenException("Error: Unable to open output dir: " + go.getGenSrcDir() + ", file: " + fileName, ex);
}
return file;
@@ -63,96 +60,96 @@
throws GenException {
OutputStream os = null;
- if (_file != null) {
+ if (file != null) {
//System.out.println( "Output file already opened" );
return;
}
- _file = getFile();
+ file = getFile();
- if (_file == null) {
+ if (file == null) {
throw new GenException("Error: Unable to obtain output file.");
}
if (getGenOptions().isVerbose()) {
- System.out.println("Generating: " + _file);
+ System.out.println("Generating: " + file);
}
os = null;
//if (_file.isFile())
//{
- _file.getParentFile().mkdirs();
+ file.getParentFile().mkdirs();
//}
- if (_file.exists() && !_file.canWrite()) {
- throw new GenException("Error: Unable to write to file: " + _file);
+ if (file.exists() && !file.canWrite()) {
+ throw new GenException("Error: Unable to write to file: " + file);
}
- if (!_file.exists() && !_file.getParentFile().canWrite()) {
- throw new GenException("Error: Unable to write to directory: " + _file.getParentFile());
+ if (!file.exists() && !file.getParentFile().canWrite()) {
+ throw new GenException("Error: Unable to write to directory: " + file.getParentFile());
}
try {
- os = new FileOutputStream(_file);
+ os = new FileOutputStream(file);
} catch (Exception ex) {
- throw new GenException("Error: Unable to init output file: " + _file, ex);
+ throw new GenException("Error: Unable to init output file: " + file, ex);
}
try {
- _pw = new PrintWriter(new OutputStreamWriter(os));
+ pw = new PrintWriter(new OutputStreamWriter(os));
} catch (Exception ex) {
- throw new GenException("Error: Unable to init output file: " + _file, ex);
+ throw new GenException("Error: Unable to init output file: " + file, ex);
}
}
public void closeFile()
throws GenException {
- if (_pw != null) {
+ if (pw != null) {
try {
- _pw.flush();
- _pw.close();
+ pw.flush();
+ pw.close();
} catch (Exception e) {
- throw new GenException("Error: Unable to close output file: " + _file, e);
+ throw new GenException("Error: Unable to close output file: " + file, e);
}
- _pw = null;
+ pw = null;
}
- _file = null;
+ file = null;
}
public void indent() {
- _indentPos += 4;
- if (_indentPos > _spaces.length()) {
- _indentPos -= 4;
+ indentPos += 4;
+ if (indentPos > spaces.length()) {
+ indentPos -= 4;
}
- _indentStr = _spaces.substring(0, _indentPos);
+ indentStr = spaces.substring(0, indentPos);
}
public void outdent() {
- _indentPos -= 4;
- if (_indentPos < 0) {
- _indentPos = 0;
+ indentPos -= 4;
+ if (indentPos < 0) {
+ indentPos = 0;
}
- _indentStr = _spaces.substring(0, _indentPos);
+ indentStr = spaces.substring(0, indentPos);
}
public void begin() {
- _needIndent = true;
+ needIndent = true;
println("{");
indent();
}
public void end() {
outdent();
- _needIndent = true;
+ needIndent = true;
println("}");
}
public void newln() {
println("");
- _needIndent = true;
+ needIndent = true;
}
public void comment(String msg) {
@@ -160,21 +157,21 @@
}
public void println(String line) {
- if (_needIndent) {
- _needIndent = false;
- _pw.print(_indentStr);
+ if (needIndent) {
+ needIndent = false;
+ pw.print(indentStr);
}
- _pw.println(line);
- _needIndent = true;
+ pw.println(line);
+ needIndent = true;
}
public void print(String line) {
- if (_needIndent) {
- _needIndent = false;
- _pw.print(_indentStr);
+ if (needIndent) {
+ needIndent = false;
+ pw.print(indentStr);
}
- _pw.print(line);
+ pw.print(line);
}
}
Modified: geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/naming/InitialContext.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/naming/InitialContext.java?view=diff&r1=158813&r2=158814
==============================================================================
--- geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/naming/InitialContext.java (original)
+++ geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/naming/InitialContext.java Wed Mar 23 09:56:34 2005
@@ -29,10 +29,10 @@
public class InitialContext implements Context, java.io.Serializable {
private static HashMap EMPTY_MAP = new HashMap();
- private String _prefix;
+ private String prefix;
InitialContext(String prefix) {
- _prefix = prefix;
+ this.prefix = prefix;
}
public HashMap getMap() {
@@ -53,7 +53,7 @@
if (namingContext == null) {
namingContext = NamingContext.getInstance(NameService.class);
}
- return namingContext.lookup(name, _prefix);
+ return namingContext.lookup(name, prefix);
}
public Object lookupReturnNullIfNotFound(String name) {
@@ -61,7 +61,7 @@
if (namingContext == null) {
return null;
} else {
- return namingContext.lookupReturnNullIfNotFound(name, _prefix);
+ return namingContext.lookupReturnNullIfNotFound(name, prefix);
}
}
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=158813&r2=158814
==============================================================================
--- 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 09:56:34 2005
@@ -19,7 +19,6 @@
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=158813&r2=158814
==============================================================================
--- 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 09:56:34 2005
@@ -21,25 +21,22 @@
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 {
- protected static NameService _ns = null;
+ private static NameService ns = null;
+ private final Log log = LogFactory.getLog(NameService.class);
- public static NameService getInstance() {
- if (_ns == null) {
- synchronized (NameService.class) {
- if (_ns == null) {
- _ns = new NameService();
- _ns.init();
- }
- }
+ public static synchronized NameService getInstance() {
+ 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?
@@ -48,19 +45,23 @@
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=158813&r2=158814
==============================================================================
--- 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 09:56:34 2005
@@ -22,48 +22,55 @@
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 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;
}
@@ -74,19 +81,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 {
@@ -98,7 +105,7 @@
if (prefix != null) {
name += prefix + "/" + name;
}
- return _map.get(name);
+ return map.get(name);
}
protected void init(Class baseClass) {
@@ -106,42 +113,31 @@
// this logic isn't required for the CORBA container.
}
- protected void bindAdapter(Adapter adp) {
- _map.put(adp.getBindName(), adp);
+ 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 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=158813&r2=158814
==============================================================================
--- 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 09:56:34 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(_propertyName, String.valueOf(_defaultValue));
+ String value = props.getProperty(getPropertyName(), 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=158813&r2=158814
==============================================================================
--- 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 09:56:34 2005
@@ -18,11 +18,9 @@
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);
@@ -54,34 +52,34 @@
}
public ByteProperty defaultValue(byte defaultValue) {
- _defaultValue = defaultValue;
+ this.defaultValue = defaultValue;
return this;
}
public ByteProperty minimumValue(byte minimumValue) {
- _minimumValue = minimumValue;
+ this.minimumValue = minimumValue;
return this;
}
public ByteProperty maximumValue(byte maximumValue) {
- _maximumValue = maximumValue;
+ this.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() {
@@ -91,20 +89,20 @@
public byte getByte(String instanceName, PropertyMap props) {
byte n;
boolean ok = true;
- String value = props.getProperty(_propertyName, String.valueOf(_defaultValue));
+ String value = props.getProperty(getPropertyName(), 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=158813&r2=158814
==============================================================================
--- 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 09:56:34 2005
@@ -17,15 +17,10 @@
*/
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);
@@ -57,34 +52,34 @@
}
public DoubleProperty defaultValue(double defaultValue) {
- _defaultValue = defaultValue;
+ this.defaultValue = defaultValue;
return this;
}
public DoubleProperty minimumValue(double minimumValue) {
- _minimumValue = minimumValue;
+ this.minimumValue = minimumValue;
return this;
}
public DoubleProperty maximumValue(double maximumValue) {
- _maximumValue = maximumValue;
+ this.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() {
@@ -94,20 +89,20 @@
public double getDouble(String instanceName, PropertyMap props) {
double n;
boolean ok = true;
- String value = props.getProperty(_propertyName, String.valueOf(_defaultValue));
+ String value = props.getProperty(getPropertyName(), 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=158813&r2=158814
==============================================================================
--- 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 09:56:34 2005
@@ -18,11 +18,9 @@
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);
@@ -54,34 +52,34 @@
}
public FloatProperty defaultValue(float defaultValue) {
- _defaultValue = defaultValue;
+ this.defaultValue = defaultValue;
return this;
}
public FloatProperty minimumValue(float minimumValue) {
- _minimumValue = minimumValue;
+ this.minimumValue = minimumValue;
return this;
}
public FloatProperty maximumValue(float maximumValue) {
- _maximumValue = maximumValue;
+ this.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() {
@@ -91,20 +89,20 @@
public float getFloat(String instanceName, PropertyMap props) {
float n;
boolean ok = true;
- String value = props.getProperty(_propertyName, String.valueOf(_defaultValue));
+ String value = props.getProperty(getPropertyName(), 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=158813&r2=158814
==============================================================================
--- 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 09:56:34 2005
@@ -18,11 +18,9 @@
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);
@@ -54,34 +52,34 @@
}
public IntProperty defaultValue(int defaultValue) {
- _defaultValue = defaultValue;
+ this.defaultValue = defaultValue;
return this;
}
public IntProperty minimumValue(int minimumValue) {
- _minimumValue = minimumValue;
+ this.minimumValue = minimumValue;
return this;
}
public IntProperty maximumValue(int maximumValue) {
- _maximumValue = maximumValue;
+ this.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() {
@@ -91,20 +89,20 @@
public int getInt(String instanceName, PropertyMap props) {
int n;
boolean ok = true;
- String value = props.getProperty(_propertyName, String.valueOf(_defaultValue));
+ String value = props.getProperty(getPropertyName(), 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=158813&r2=158814
==============================================================================
--- 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 09:56:34 2005
@@ -17,15 +17,10 @@
*/
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);
@@ -57,65 +52,57 @@
}
public LongProperty defaultValue(long defaultValue) {
- _defaultValue = defaultValue;
+ this.defaultValue = defaultValue;
return this;
}
public LongProperty minimumValue(long minimumValue) {
- _minimumValue = minimumValue;
+ this.minimumValue = minimumValue;
return this;
}
public LongProperty maximumValue(long maximumValue) {
- _maximumValue = maximumValue;
+ this.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(_propertyName, String.valueOf(_defaultValue));
+ String value = props.getProperty(getPropertyName(), 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=158813&r2=158814
==============================================================================
--- 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 09:56:34 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) {
- _instanceName = instanceName;
+ this.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=158813&r2=158814
==============================================================================
--- 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 09:56:34 2005
@@ -21,46 +21,38 @@
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;
}
}
- protected Class _componentClass;
-
- protected String _propertyName;
-
- protected String _displayName;
-
- protected String _displayOnlyIfOther;
-
- protected String _displayOnlyIfValue;
-
- protected String _description;
-
- protected String _consoleHelp;
-
- protected int _sortOrder;
+ private Class componentClass;
+ private String propertyName;
+ private String displayName;
+ private String displayOnlyIfOther;
+ private String displayOnlyIfValue;
+ private String description;
+ private String consoleHelp;
+ private int sortOrder;
public PropertyType(Class componentClass, String propertyName) {
- _componentClass = componentClass;
- _propertyName = propertyName;
+ this.componentClass = componentClass;
+ this.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();
@@ -68,31 +60,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() {
@@ -108,24 +100,24 @@
}
public void setDisplayName(String displayName) {
- _displayName = displayName;
+ this.displayName = displayName;
}
public void setDisplayOnlyIf(PropertyType other, String value) {
- _displayOnlyIfOther = other.getPropertyName();
- _displayOnlyIfValue = value;
+ displayOnlyIfOther = other.getPropertyName();
+ displayOnlyIfValue = value;
}
public void setDescription(String description) {
- _description = description;
+ this.description = description;
}
public void setConsoleHelp(String consoleHelp) {
- _consoleHelp = consoleHelp;
+ this.consoleHelp = consoleHelp;
}
public void setSortOrder(int sortOrder) {
- _sortOrder = sortOrder;
+ this.sortOrder = sortOrder;
}
public void badPropertyValue(String instanceName, String value) {
@@ -169,20 +161,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);
}
@@ -200,6 +192,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=158813&r2=158814
==============================================================================
--- 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 09:56:34 2005
@@ -18,11 +18,9 @@
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);
@@ -54,34 +52,34 @@
}
public ShortProperty defaultValue(short defaultValue) {
- _defaultValue = defaultValue;
+ this.defaultValue = defaultValue;
return this;
}
public ShortProperty minimumValue(short minimumValue) {
- _minimumValue = minimumValue;
+ this.minimumValue = minimumValue;
return this;
}
public ShortProperty maximumValue(short maximumValue) {
- _maximumValue = maximumValue;
+ this.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() {
@@ -91,20 +89,20 @@
public short getShort(String instanceName, PropertyMap props) {
short n;
boolean ok = true;
- String value = props.getProperty(_propertyName, String.valueOf(_defaultValue));
+ String value = props.getProperty(getPropertyName(), 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=158813&r2=158814
==============================================================================
--- 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 09:56:34 2005
@@ -28,25 +28,16 @@
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);
@@ -78,41 +69,41 @@
}
public StringProperty defaultValue(String defaultValue) {
- _defaultValue = defaultValue;
+ this.defaultValue = defaultValue;
return this;
}
public StringProperty legalValues(Class valueIsNameOf) {
- _valueIsNameOf = valueIsNameOf;
+ this.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);
- _valueIsInList = new ArrayList(list.size());
+ this.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);
}
- _valueIsInList.add(value);
+ this.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;
}
@@ -121,54 +112,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 {
@@ -182,7 +173,7 @@
public String getString(String instanceName, PropertyMap props) {
boolean ok = true, usingDefaultValue = false;
- String s = props.getProperty(_propertyName, _defaultValue);
+ String s = props.getProperty(getPropertyName(), defaultValue);
if (s != null && s.startsWith("${")) {
// Value is contained in system property.
s = StringUtil.removePrefix(s, "${");
@@ -191,7 +182,7 @@
s = sp.getString();
if (s == null || s.length() == 0) {
if (isRequired()) {
- String message = getLog(instanceName).errorMissingValueForRequiredSystemProperty(sp.getPropertyName(), _propertyName, getContext(instanceName));
+ String message = getLog(instanceName).errorMissingValueForRequiredSystemProperty(sp.getPropertyName(), getPropertyName(), getContext(instanceName));
throw new MissingRequiredPropertyException(message);
}
}
@@ -216,17 +207,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(_propertyName, getContext(instanceName));
+ String message = getLog(instanceName).errorMissingValueForRequiredProperty(getPropertyName(), 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=158813&r2=158814
==============================================================================
--- 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 09:56:34 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=158813&r2=158814
==============================================================================
--- 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 09:56:34 2005
@@ -17,9 +17,6 @@
*/
package org.apache.geronimo.interop.properties;
-
-
-
public class SystemPropertyLog {
public static SystemPropertyLog getInstance(String instanceName) {
SystemPropertyLog log = new SystemPropertyLog();
@@ -27,31 +24,15 @@
return log;
}
- // -----------------------------------------------------------------------
- // private data
- // -----------------------------------------------------------------------
-
- private String _instanceName;
-
- // -----------------------------------------------------------------------
- // public methods
- // -----------------------------------------------------------------------
+ private String instanceName;
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=158813&r2=158814
==============================================================================
--- 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 09:56:34 2005
@@ -1,23 +0,0 @@
-/**
- *
- * 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 {
- // ??
-}
|