filled in more skeletons for linked conference implementation; updated the

Javadoc task to include docs for the conferencing module and SourceID add-ons
This commit is contained in:
Eric J. Bowersox 2003-06-26 10:10:26 +00:00
parent 5f2ae502b0
commit a6286c3842
11 changed files with 758 additions and 15 deletions

View File

@ -600,13 +600,36 @@
<pathelement location="src/baseutil"/>
<pathelement location="src/dynamo-framework"/>
<pathelement location="src/venice-base"/>
<pathelement location="src/conferencing-module"/>
<pathelement location="src/venice-sso-helper"/>
</sourcepath>
<classpath>
<path refid="base.build.path"/>
</classpath>
<group title="Base Utility Packages" packages="com.silverwrist.util:com.silverwrist.util.*"/>
<group title="Low-Level Dynamo Framework" packages="com.silverwrist.dynamo:com.silverwrist.dynamo.*"/>
<group title="Mid-Level Venice Classes" packages="com.silverwrist.venice:com.silverwrist.venice.*"/>
<group title="Mid-Level Venice Classes">
<package name="com.silverwrist.venice"/>
<package name="com.silverwrist.venice.app"/>
<package name="com.silverwrist.venice.community"/>
<package name="com.silverwrist.venice.content"/>
<package name="com.silverwrist.venice.dialog"/>
<package name="com.silverwrist.venice.event"/>
<package name="com.silverwrist.venice.except"/>
<package name="com.silverwrist.venice.frame"/>
<package name="com.silverwrist.venice.iface"/>
<package name="com.silverwrist.venice.menu"/>
<package name="com.silverwrist.venice.obj"/>
<package name="com.silverwrist.venice.script"/>
<package name="com.silverwrist.venice.servlet"/>
<package name="com.silverwrist.venice.session"/>
<package name="com.silverwrist.venice.sidebox"/>
<package name="com.silverwrist.venice.sidebox.test"/>
<package name="com.silverwrist.venice.util"/>
<package name="com.silverwrist.venice.xmlrpc"/>
</group>
<group title="Conferencing Module" packages="com.silverwrist.venice.conf:com.silverwrist.venice.conf.*"/>
<group title="SourceID Support Add-On" packages="com.silverwrist.venice.sourceid"/>
<link href="http://java.sun.com/j2se/1.4.1/docs/api/"/>
<link href="http://java.sun.com/j2ee/sdk_1.3/techdocs/api/"/>
<link href="http://java.sun.com/products/javabeans/glasgow/javadocs/"/>
@ -616,6 +639,7 @@
<link href="http://jakarta.apache.org/log4j/docs/api/"/>
<link href="http://jakarta.apache.org/velocity/api/"/>
<link href="http://jakarta.apache.org/lucene/docs/api/"/>
<link href="http://www.sourceid.org/docs/sso/api/"/>
</javadoc>
</target>

View File

@ -30,6 +30,7 @@ abstract class ConferenceManagerOps extends OpsBase
*/
private ConferenceOps m_confops = null;
private LinkedConferenceOps m_linkedops = null;
/*--------------------------------------------------------------------------------
* Constructor
@ -52,6 +53,9 @@ abstract class ConferenceManagerOps extends OpsBase
if (m_confops!=null)
m_confops.dispose();
m_confops = null;
if (m_linkedops!=null)
m_linkedops.dispose();
m_linkedops = null;
super.dispose();
} // end dispose
@ -63,6 +67,8 @@ abstract class ConferenceManagerOps extends OpsBase
protected abstract ConferenceOps createConferenceOps(DBConnectionPool pool);
protected abstract LinkedConferenceOps createLinkedConferenceOps(DBConnectionPool pool);
/*--------------------------------------------------------------------------------
* External operations
*--------------------------------------------------------------------------------
@ -76,6 +82,14 @@ abstract class ConferenceManagerOps extends OpsBase
} // end getConferenceOps
synchronized LinkedConferenceOps getLinkedConferenceOps()
{
if (m_linkedops==null)
m_linkedops = createLinkedConferenceOps(getPool());
return m_linkedops;
} // end getConferenceOps
/*--------------------------------------------------------------------------------
* External static operations
*--------------------------------------------------------------------------------

View File

@ -48,4 +48,10 @@ public class ConferenceManagerOps_mysql extends ConferenceManagerOps
} // end createConferenceOps
protected LinkedConferenceOps createLinkedConferenceOps(DBConnectionPool pool)
{
return new LinkedConferenceOps_mysql(pool);
} // end createLinkedConferenceOps
} // end class ConferenceManagerOps_mysql

View File

@ -0,0 +1,320 @@
/*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* (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.mozilla.org/MPL/>.
*
* Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
* WARRANTY OF ANY KIND, either express or implied. See the License for the specific
* language governing rights and limitations under the License.
*
* The Original Code is the Venice Web Communities System.
*
* The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
* for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
* Copyright (C) 2003 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
*
* Contributor(s):
*/
package com.silverwrist.venice.conf.impl;
import java.security.acl.*;
import java.util.*;
import com.silverwrist.dynamo.iface.*;
import com.silverwrist.dynamo.except.*;
import com.silverwrist.venice.iface.*;
import com.silverwrist.venice.conf.iface.*;
import com.silverwrist.venice.conf.obj.*;
class LinkedConferenceImpl implements VeniceLinkedConference
{
/*--------------------------------------------------------------------------------
* Attributes
*--------------------------------------------------------------------------------
*/
private DynamicImplLinkedConference m_dobj;
private LinkedConferenceOps m_ops;
private ConferenceImpl m_conf;
private VeniceCommunity m_comm;
/*--------------------------------------------------------------------------------
* Constructor
*--------------------------------------------------------------------------------
*/
LinkedConferenceImpl(LinkedConferenceOps ops, ConferenceImpl conf, VeniceCommunity comm)
{
m_dobj = new DynamicImplLinkedConference(this);
m_ops = ops;
m_conf = conf;
m_comm = comm;
} // end constructor
/*--------------------------------------------------------------------------------
* Implementations from interface DynamicObject
*--------------------------------------------------------------------------------
*/
public Object get(String property_name) throws DynamicObjectException
{
return m_dobj.get(property_name);
} // end get
public void set(String property_name, Object value) throws DynamicObjectException
{
m_dobj.set(property_name,value);
} // end set
public Object call(String method_name, Object[] parameters) throws DynamicObjectException
{
return m_dobj.call(method_name,parameters);
} // end call
public Object call(String method_name, List parameters) throws DynamicObjectException
{
return m_dobj.call(method_name,parameters);
} // end call
public DynamicClass getDClass()
{
return m_dobj.getDClass();
} // end getDClass
/*--------------------------------------------------------------------------------
* Implementations from interface NamedObject
*--------------------------------------------------------------------------------
*/
/**
* Returns the name of this object.
*
* @return The name of this object.
*/
public String getName()
{
return m_conf.getName();
} // end getName
/*--------------------------------------------------------------------------------
* Implementations from interface ObjectProvider
*--------------------------------------------------------------------------------
*/
/**
* Retrieves an object from this <CODE>ObjectProvider</CODE>.
*
* @param namespace The namespace to interpret the name relative to.
* @param name The name of the object to be retrieved.
* @return The object reference specified.
*/
public Object getObject(String namespace, String name)
{
return m_conf.getObject(namespace,name);
} // end getObject
/*--------------------------------------------------------------------------------
* Implementations from interface SecureObjectStore
*--------------------------------------------------------------------------------
*/
/**
* Sets an object into this <CODE>SecureObjectStore</CODE>.
*
* @param caller The user performing the operation.
* @param namespace The namespace to interpret the name relative to.
* @param name The name of the object to be set.
* @param value The object to set into the <CODE>SecureObjectStore</CODE>.
* @return The previous object that was set into the <CODE>SecureObjectStore</CODE> under this namespace and name, or
* <CODE>null</CODE> if there was no such object.
* @exception com.silverwrist.dynamo.except.DatabaseException If there was an error setting the object value.
* @exception com.silverwrist.dynamo.except.DynamoSecurityException If the specified user is not permitted to
* set this object value into this <CODE>SecureObjectStore</CODE>.
*/
public Object setObject(DynamoUser caller, String namespace, String name, Object value)
throws DatabaseException, DynamoSecurityException
{
return m_conf.setObject(caller,namespace,name,value);
} // end setObject
/**
* Removes an object from this <CODE>SecureObjectStore</CODE>.
*
* @param caller The user performing the operation.
* @param namespace The namespace to interpret the name relative to.
* @param name The name of the object to be removed.
* @return The previous object that was set into the <CODE>SecureObjectStore</CODE> under this namespace and name, or
* <CODE>null</CODE> if there was no such object.
* @exception com.silverwrist.dynamo.except.DatabaseException If there was an error removing the object value.
* @exception com.silverwrist.dynamo.except.DynamoSecurityException If the specified user is not permitted to
* remove this object value from this <CODE>SecureObjectStore</CODE>.
*/
public Object removeObject(DynamoUser caller, String namespace, String name)
throws DatabaseException, DynamoSecurityException
{
return m_conf.removeObject(caller,namespace,name);
} // end removeObject
/**
* Returns a collection of all object namespaces that have been set into this <CODE>SecureObjectStore</CODE>.
*
* @return A {@link java.util.Collection Collection} containing {@link java.lang.String String} objects specifying
* all the object namespaces.
* @exception com.silverwrist.dynamo.except.DatabaseException If there was an error getting the namespace list.
*/
public Collection getNamespaces() throws DatabaseException
{
return m_conf.getNamespaces();
} // end getNamespaces
/**
* Returns a collection of all object names that have been set into this <CODE>SecureObjectStore</CODE> under
* a given namespace.
*
* @param namespace The namespace to look for names under.
* @return A {@link java.util.Collection Collection} containing {@link java.lang.String String} objects
* specifying all the object names for this namespace.
* @exception com.silverwrist.dynamo.except.DatabaseException If there was an error getting the object name list.
*/
public Collection getNamesForNamespace(String namespace) throws DatabaseException
{
return m_conf.getNamesForNamespace(namespace);
} // end getNamesForNamespace
/*--------------------------------------------------------------------------------
* Implementations from interface VeniceConference
*--------------------------------------------------------------------------------
*/
public int getConfID()
{
return m_conf.getConfID();
} // end getConfID
public void setName(DynamoUser caller, String name) throws DatabaseException, DynamoSecurityException
{
m_conf.setName(caller,name);
} // end setName
public java.util.Date getCreatedDate()
{
return m_conf.getCreatedDate();
} // end getCreatedDate
public java.util.Date getLastUpdateDate()
{
return m_conf.getLastUpdateDate();
} // end getLastUpdateDate
public void setLastUpdateDate(DynamoUser caller, java.util.Date date)
throws DatabaseException, DynamoSecurityException
{
m_conf.setLastUpdateDate(caller,date);
} // end setLastUpdateDate
public int getHostsGID()
{
return m_conf.getHostsGID();
} // end getHostsGID
public DynamoGroup getHosts() throws DatabaseException
{
return m_conf.getHosts();
} // end getHosts
public DynamoAcl getAcl() throws DatabaseException, AclNotFoundException
{
return m_conf.getAcl();
} // end getAcl
public Set getAliases() throws DatabaseException
{
return m_conf.getAliases();
} // end getAliases
public String getPrimaryAlias() throws DatabaseException
{
return m_conf.getPrimaryAlias();
} // end getPrimaryAlias
public void setPrimaryAlias(DynamoUser caller, String alias) throws DatabaseException, DynamoSecurityException
{
m_conf.setPrimaryAlias(caller,alias);
} // end setPrimaryAlias
public void addAlias(DynamoUser caller, String alias) throws DatabaseException, DynamoSecurityException
{
m_conf.addAlias(caller,alias);
} // end addAlias
public void removeAlias(DynamoUser caller, String alias) throws DatabaseException, DynamoSecurityException
{
m_conf.removeAlias(caller,alias);
} // end removeAlias
/*--------------------------------------------------------------------------------
* Implementations from interface VeniceLinkedConference
*--------------------------------------------------------------------------------
*/
public VeniceCommunity getCommunity()
{
return m_comm;
} // end getCommunity
public VeniceConference getConference()
{
return m_conf;
} // end getConference
public int getSequence()
{
return -1; // TEMP
}
public void setSequence(DynamoUser caller, int sequence) throws DatabaseException, DynamoSecurityException
{
}
public boolean isHidden()
{
return false; // TEMP
}
public void setHidden(DynamoUser caller, boolean flag) throws DatabaseException, DynamoSecurityException
{
}
public void unlink(DynamoUser caller) throws DatabaseException, DynamoSecurityException
{
}
} // end class LinkedConferenceImpl

View File

@ -0,0 +1,43 @@
/*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* (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.mozilla.org/MPL/>.
*
* Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
* WARRANTY OF ANY KIND, either express or implied. See the License for the specific
* language governing rights and limitations under the License.
*
* The Original Code is the Venice Web Communities System.
*
* The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
* for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
* Copyright (C) 2003 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
*
* Contributor(s):
*/
package com.silverwrist.venice.conf.impl;
import java.util.*;
import com.silverwrist.dynamo.db.OpsBase;
import com.silverwrist.dynamo.except.*;
import com.silverwrist.dynamo.iface.*;
abstract class LinkedConferenceOps extends OpsBase
{
/*--------------------------------------------------------------------------------
* Constructor
*--------------------------------------------------------------------------------
*/
protected LinkedConferenceOps(DBConnectionPool pool)
{
super(pool);
} // end constructor
/*--------------------------------------------------------------------------------
* Abstract operations
*--------------------------------------------------------------------------------
*/
} // end class LinkedConferenceOps

View File

@ -0,0 +1,45 @@
/*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* (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.mozilla.org/MPL/>.
*
* Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
* WARRANTY OF ANY KIND, either express or implied. See the License for the specific
* language governing rights and limitations under the License.
*
* The Original Code is the Venice Web Communities System.
*
* The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
* for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
* Copyright (C) 2003 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
*
* Contributor(s):
*/
package com.silverwrist.venice.conf.impl;
import java.sql.*;
import java.util.*;
import com.silverwrist.util.*;
import com.silverwrist.dynamo.except.*;
import com.silverwrist.dynamo.iface.*;
import com.silverwrist.dynamo.util.*;
class LinkedConferenceOps_mysql extends LinkedConferenceOps
{
/*--------------------------------------------------------------------------------
* Constructor
*--------------------------------------------------------------------------------
*/
LinkedConferenceOps_mysql(DBConnectionPool pool)
{
super(pool);
} // end constructor
/*--------------------------------------------------------------------------------
* Abstract implementations from class LinkedConferenceOps
*--------------------------------------------------------------------------------
*/
} // end class LinkedConferenceOps_mysql

View File

@ -25,7 +25,7 @@ import com.silverwrist.venice.conf.iface.*;
class DynamicClassConference extends DynamicClassImpl
{
/*--------------------------------------------------------------------------------
* Constructor
* Constructors
*--------------------------------------------------------------------------------
*/
@ -35,6 +35,12 @@ class DynamicClassConference extends DynamicClassImpl
} // end constructor
protected DynamicClassConference(String name)
{
super(name);
} // end constructor
/*--------------------------------------------------------------------------------
* Overrides from class DynamicClassImpl
*--------------------------------------------------------------------------------

View File

@ -0,0 +1,57 @@
/*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* (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.mozilla.org/MPL/>.
*
* Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
* WARRANTY OF ANY KIND, either express or implied. See the License for the specific
* language governing rights and limitations under the License.
*
* The Original Code is the Venice Web Communities System.
*
* The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
* for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
* Copyright (C) 2003 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
*
* Contributor(s):
*/
package com.silverwrist.venice.conf.obj;
import com.silverwrist.dynamo.except.*;
import com.silverwrist.dynamo.iface.*;
import com.silverwrist.dynamo.obj.*;
import com.silverwrist.venice.conf.iface.*;
class DynamicClassLinkedConference extends DynamicClassConference
{
/*--------------------------------------------------------------------------------
* Constructors
*--------------------------------------------------------------------------------
*/
DynamicClassLinkedConference()
{
super("Dynamic." + VeniceLinkedConference.class.getName());
} // end constructor
protected DynamicClassLinkedConference(String name)
{
super(name);
} // end constructor
/*--------------------------------------------------------------------------------
* Overrides from class DynamicClassImpl
*--------------------------------------------------------------------------------
*/
public DynamicObject cast(Object source) throws ClassCastException
{
if (source instanceof VeniceLinkedConference)
return (DynamicObject)source;
return super.cast(source);
} // end cast
} // end class DynamicClassLinkedConference

View File

@ -89,8 +89,8 @@ public class DynamicImplConferenceAccess extends DynamicObjectImpl
verifyParameterLength(method_name,parameters,1);
if ((parameters[0]==null) || (parameters[0] instanceof String))
return m_impl.getConference((String)(parameters[0]));
verifyParameterNumber(method_name,parameters,0);
return m_impl.getConference(getIntValue(parameters[0]));
int foo = getIntValue(method_name,parameters,0);
return m_impl.getConference(foo);
} // end try
catch (DatabaseException e)

View File

@ -0,0 +1,200 @@
/*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* (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.mozilla.org/MPL/>.
*
* Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
* WARRANTY OF ANY KIND, either express or implied. See the License for the specific
* language governing rights and limitations under the License.
*
* The Original Code is the Venice Web Communities System.
*
* The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
* for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
* Copyright (C) 2003 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
*
* Contributor(s):
*/
package com.silverwrist.venice.conf.obj;
import java.security.acl.*;
import java.util.*;
import com.silverwrist.dynamo.except.*;
import com.silverwrist.dynamo.iface.*;
import com.silverwrist.dynamo.obj.*;
import com.silverwrist.venice.iface.*;
import com.silverwrist.venice.conf.iface.*;
public class DynamicImplLinkedConference extends DynamicImplConference
{
/*--------------------------------------------------------------------------------
* Static data members
*--------------------------------------------------------------------------------
*/
private static DynamicClass s_baseclass = null;
/*--------------------------------------------------------------------------------
* Attributes
*--------------------------------------------------------------------------------
*/
private VeniceLinkedConference m_impl;
/*--------------------------------------------------------------------------------
* Constructors
*--------------------------------------------------------------------------------
*/
public DynamicImplLinkedConference(VeniceLinkedConference impl, DynamicClass dclass)
{
super(impl,dclass);
m_impl = impl;
} // end constructor
public DynamicImplLinkedConference(VeniceLinkedConference impl)
{
super(impl,getBaseDClass());
m_impl = impl;
} // end constructor
/*--------------------------------------------------------------------------------
* Overrides from class DynamicObjectImpl
*--------------------------------------------------------------------------------
*/
public Object get(String property_name) throws DynamicObjectException
{
if (property_name.equals("community"))
return m_impl.getCommunity();
if (property_name.equals("conference"))
return m_impl.getConference();
if (property_name.equals("sequence"))
return new Integer(m_impl.getSequence());
if (property_name.equals("hidden"))
return Boolean.valueOf(m_impl.isHidden());
return super.get(property_name);
} // end get
public Object call(String method_name, Object[] parameters) throws DynamicObjectException
{
if (method_name.equals("getCommunity"))
{ // verify parameters and call method
verifyParameterLength(method_name,parameters,0);
return m_impl.getCommunity();
} // end if
if (method_name.equals("getConference"))
{ // verify parameters and call method
verifyParameterLength(method_name,parameters,0);
return m_impl.getConference();
} // end if
if (method_name.equals("getSequence"))
{ // verify parameters and call method
verifyParameterLength(method_name,parameters,0);
return new Integer(m_impl.getSequence());
} // end if
if (method_name.equals("setSequence"))
{ // verify parameters and call method
try
{ // make sure and catch exceptions
verifyParameterLength(method_name,parameters,2);
verifyParameterType(method_name,parameters,0,DynamoUser.class);
int foo = getIntValue(method_name,parameters,1);
m_impl.setSequence((DynamoUser)(parameters[0]),foo);
return null;
} // end try
catch (DatabaseException e)
{ // catch and turn into a call failure
throw callFailed(e);
} // end catch
catch (DynamoSecurityException e)
{ // catch and turn into a call failure
throw callFailed(e);
} // end catch
} // end if
if (method_name.equals("isHidden"))
{ // verify parameters and call method
verifyParameterLength(method_name,parameters,0);
return Boolean.valueOf(m_impl.isHidden());
} // end if
if (method_name.equals("setHidden"))
{ // verify parameters and call method
try
{ // make sure and catch exceptions
verifyParameterLength(method_name,parameters,2);
verifyParameterType(method_name,parameters,0,DynamoUser.class);
boolean foo = getBooleanValue(method_name,parameters,1);
m_impl.setHidden((DynamoUser)(parameters[0]),foo);
return null;
} // end try
catch (DatabaseException e)
{ // catch and turn into a call failure
throw callFailed(e);
} // end catch
catch (DynamoSecurityException e)
{ // catch and turn into a call failure
throw callFailed(e);
} // end catch
} // end if
if (method_name.equals("unlink"))
{ // verify parameters and call method
try
{ // make sure and catch exceptions
verifyParameterLength(method_name,parameters,1);
verifyParameterType(method_name,parameters,0,DynamoUser.class);
m_impl.unlink((DynamoUser)(parameters[0]));
return null;
} // end try
catch (DatabaseException e)
{ // catch and turn into a call failure
throw callFailed(e);
} // end catch
catch (DynamoSecurityException e)
{ // catch and turn into a call failure
throw callFailed(e);
} // end catch
} // end if
return super.call(method_name,parameters);
} // end call
/*--------------------------------------------------------------------------------
* External static operations
*--------------------------------------------------------------------------------
*/
public static synchronized DynamicClass getBaseDClass()
{
if (s_baseclass==null)
s_baseclass = new DynamicClassLinkedConference();
return s_baseclass;
} // end getBaseDClass
} // end class DynamicImplLinkedConference

View File

@ -18,6 +18,7 @@
package com.silverwrist.dynamo.obj;
import java.util.*;
import com.silverwrist.util.*;
import com.silverwrist.dynamo.except.*;
import com.silverwrist.dynamo.iface.*;
@ -46,22 +47,22 @@ public class DynamicObjectImpl implements DynamicObject
*--------------------------------------------------------------------------------
*/
protected static final int getIntValue(Object param)
{
return ((Number)param).intValue();
} // end getIntValue
protected final CallFailureException callFailed(Throwable cause)
{
return new CallFailureException(m_dclass,cause);
} // end callFailed
protected final ParameterCountException badCount(String method_name, Object[] parameters, int len)
{
return new ParameterCountException(m_dclass,method_name,len,parameters.length);
} // end badCount
protected final void verifyParameterLength(String method_name, Object[] parameters, int len)
{
if (parameters.length!=len)
throw new ParameterCountException(m_dclass,method_name,len,parameters.length);
throw badCount(method_name,parameters,len);
} // end verifyParameterLength
@ -80,14 +81,41 @@ public class DynamicObjectImpl implements DynamicObject
} // end verifyParameterType
protected final void verifyParameterNumber(String method_name, Object[] parameters, int ndx)
protected final int getIntValue(String method_name, Object[] parameters, int ndx)
{
if (parameters[ndx]==null)
throw badType(method_name,ndx,Number.class,null);
if (!(parameters[ndx] instanceof Number))
throw badType(method_name,ndx,Number.class,parameters[ndx].getClass());
if (parameters[ndx] instanceof Number)
return ((Number)(parameters[ndx])).intValue();
try
{ // parse string equivalent as integer
return Integer.parseInt(parameters[ndx].toString());
} // end verifyParameterNumber
} // end try
catch (NumberFormatException e)
{ // this is where the type error goes...
throw badType(method_name,ndx,Integer.class,parameters[ndx].getClass());
} // end catch
} // end getIntValue
protected final boolean getBooleanValue(String method_name, Object[] parameters, int ndx)
{
if (parameters[ndx]==null)
throw badType(method_name,ndx,Boolean.class,null);
if (parameters[ndx] instanceof Boolean)
return ((Boolean)(parameters[ndx])).booleanValue();
if (parameters[ndx] instanceof Number)
return (((Number)(parameters[ndx])).intValue()!=0);
String s = parameters[ndx].toString();
if (StringUtils.isBooleanTrue(s))
return true;
if (StringUtils.isBooleanFalse(s))
return false;
throw badType(method_name,ndx,Boolean.class,parameters[ndx].getClass());
} // end getBooleanValue
/*--------------------------------------------------------------------------------
* Implementations from interface DynamicObject