started outlining the conferencing module
This commit is contained in:
parent
c6a86a167f
commit
4534adace4
50
build.xml
50
build.xml
|
@ -168,7 +168,7 @@
|
|||
<!-- ============================================================================
|
||||
"build-dynamo" - Builds the Dynamo framework classes (com.silverwrist.dynamo.*).
|
||||
============================================================================ -->
|
||||
<target name="build-dynamo" depends="jar-baseutil,jcc-dynamo-search">
|
||||
<target name="build-dynamo" depends="init,jar-baseutil,jcc-dynamo-search">
|
||||
<mkdir dir="workingarea/dynamo-framework"/>
|
||||
<javac srcdir="src/dynamo-framework:workingarea/src-dynamo-framework" destdir="workingarea/dynamo-framework"
|
||||
source="1.4" debug="${compile.debug}" optimize="${compile.optimize}" deprecation="off">
|
||||
|
@ -195,7 +195,7 @@
|
|||
"build-dynamo-test" - Builds the Dynamo test classes
|
||||
(com.silverwrist.dynamo.test.*).
|
||||
============================================================================ -->
|
||||
<target name="build-dynamo-test" depends="jar-baseutil,jar-dynamo">
|
||||
<target name="build-dynamo-test" depends="init,jar-baseutil,jar-dynamo">
|
||||
<mkdir dir="workingarea/dynamo-test"/>
|
||||
<javac srcdir="src/dynamo-test" destdir="workingarea/dynamo-test" source="1.4"
|
||||
debug="${compile.debug}" optimize="${compile.optimize}" deprecation="${compile.deprecation}">
|
||||
|
@ -223,7 +223,7 @@
|
|||
(com.silverwrist.dynamo.testmod.*).
|
||||
============================================================================ -->
|
||||
|
||||
<target name="build-test-module" depends="jar-baseutil,jar-dynamo">
|
||||
<target name="build-test-module" depends="init,jar-baseutil,jar-dynamo">
|
||||
<mkdir dir="workingarea/dynamo-test-module"/>
|
||||
<javac srcdir="src/dynamo-test-module" destdir="workingarea/dynamo-test-module" source="1.4"
|
||||
debug="${compile.debug}" optimize="${compile.optimize}" deprecation="${compile.deprecation}">
|
||||
|
@ -256,7 +256,7 @@
|
|||
"build-venice-base" - Builds the Venice base classes (com.silverwrist.venice.*).
|
||||
============================================================================ -->
|
||||
|
||||
<target name="build-venice-base" depends="jar-baseutil,jar-dynamo">
|
||||
<target name="build-venice-base" depends="init,jar-baseutil,jar-dynamo">
|
||||
<mkdir dir="workingarea/venice-base"/>
|
||||
<javac srcdir="src/venice-base" destdir="workingarea/venice-base" source="1.4"
|
||||
debug="${compile.debug}" optimize="${compile.optimize}" deprecation="${compile.deprecation}">
|
||||
|
@ -282,7 +282,7 @@
|
|||
"build-venice-sso-helper" - Builds the Venice SourceID SSO helper classes.
|
||||
============================================================================ -->
|
||||
|
||||
<target name="build-venice-sso-helper" depends="jar-baseutil,jar-dynamo,jar-venice-base" if="sourceid.present">
|
||||
<target name="build-venice-sso-helper" depends="init,jar-baseutil,jar-dynamo,jar-venice-base" if="sourceid.present">
|
||||
<mkdir dir="workingarea/venice-sso-helper"/>
|
||||
<javac srcdir="src/venice-sso-helper" destdir="workingarea/venice-sso-helper" source="1.4"
|
||||
debug="${compile.debug}" optimize="${compile.optimize}" deprecation="${compile.deprecation}">
|
||||
|
@ -302,11 +302,40 @@
|
|||
<jar destfile="jars/venice-sso-helper.jar" basedir="workingarea/venice-sso-helper"/>
|
||||
</target>
|
||||
|
||||
<!-- ============================================================================
|
||||
"build-venice-conferencing" - Builds the Venice Conferencing module.
|
||||
============================================================================ -->
|
||||
|
||||
<target name="build-venice-conferencing" depends="init,jar-baseutil,jar-dynamo,jar-venice-base">
|
||||
<mkdir dir="workingarea/conferencing-module"/>
|
||||
<javac srcdir="src/conferencing-module" destdir="workingarea/conferencing-module" source="1.4"
|
||||
debug="${compile.debug}" optimize="${compile.optimize}" deprecation="${compile.deprecation}">
|
||||
<classpath>
|
||||
<filelist dir="jars" files="venice-base.jar,dynamo-framework.jar,baseutil.jar"/>
|
||||
<path refid="base.build.path"/>
|
||||
</classpath>
|
||||
</javac>
|
||||
</target>
|
||||
|
||||
<!-- ============================================================================
|
||||
"jar-venice-conferencing" - Builds the Venice Conferencing module.
|
||||
============================================================================ -->
|
||||
|
||||
<target name="jar-venice-conferencing" depends="init-jars,build-venice-conferencing">
|
||||
<jar destfile="jars/venice-conferencing.jar" basedir="workingarea/conferencing-module">
|
||||
<manifest>
|
||||
<attribute name="X-Dynamo-Module-Class" value="com.silverwrist.venice.conf.module.ModuleMain"/>
|
||||
<!-- <attribute name="X-Dynamo-Resource-Prefix" value="/resources"/> -->
|
||||
</manifest>
|
||||
</jar>
|
||||
</target>
|
||||
|
||||
<!-- ============================================================================
|
||||
"all-jars" - Pseudo-target that compiles all JAR files.
|
||||
============================================================================ -->
|
||||
<target name="all-jars"
|
||||
depends="init,jar-baseutil,jar-dynamo,jar-dynamo-test,jar-venice-base,jar-venice-sso-helper"/>
|
||||
depends="init,jar-baseutil,jar-dynamo,jar-dynamo-test,jar-venice-base,jar-venice-sso-helper,
|
||||
jar-venice-conferencing"/>
|
||||
|
||||
<!-- ============================================================================
|
||||
"assemble-test-app" - Pseudo-target that creates the directory structure for
|
||||
|
@ -363,6 +392,9 @@
|
|||
<fileset dir="${velocity.lib}" includes="${velocity.jarfile}"/>
|
||||
<fileset dir="${lucene.lib}" includes="${lucene.jarfile}"/>
|
||||
</copy>
|
||||
<copy todir="assembly/venice/WEB-INF/modules">
|
||||
<fileset dir="jars" includes="venice-conferencing.jar"/>
|
||||
</copy>
|
||||
<copy file="conf/dynamo-venice.xml" tofile="assembly/venice/WEB-INF/dynamo.xml"/>
|
||||
<copy file="conf/logging-venice.xml" tofile="assembly/venice/WEB-INF/logging.xml">
|
||||
<filterset>
|
||||
|
@ -421,6 +453,9 @@
|
|||
<include name="xmlsec.jar"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
<copy todir="assembly/venice-sp/WEB-INF/modules">
|
||||
<fileset dir="jars" includes="venice-conferencing.jar"/>
|
||||
</copy>
|
||||
<copy todir="assembly/venice-sp/WEB-INF/xsd" preservelastmodified="yes">
|
||||
<fileset dir="${sourceid.base}/conf" includes="*.xsd"/>
|
||||
</copy>
|
||||
|
@ -497,6 +532,9 @@
|
|||
<include name="xmlsec.jar"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
<copy todir="assembly/venice-idp/WEB-INF/modules">
|
||||
<fileset dir="jars" includes="venice-conferencing.jar"/>
|
||||
</copy>
|
||||
<copy todir="assembly/venice-idp/WEB-INF/xsd" preservelastmodified="yes">
|
||||
<fileset dir="${sourceid.base}/conf" includes="*.xsd"/>
|
||||
</copy>
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
* 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;
|
||||
|
||||
public interface ConfNamespaces
|
||||
{
|
||||
public static final String CONFERENCING_NAMESPACE =
|
||||
"http://www.silverwrist.com/NS/venice/2003/06/19/conferencing";
|
||||
|
||||
} // end interface ConfNamespaces
|
|
@ -0,0 +1,114 @@
|
|||
/*
|
||||
* 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.module;
|
||||
|
||||
import java.util.*;
|
||||
import com.silverwrist.dynamo.except.*;
|
||||
import com.silverwrist.dynamo.iface.*;
|
||||
import com.silverwrist.venice.except.*;
|
||||
import com.silverwrist.venice.iface.*;
|
||||
import com.silverwrist.venice.obj.*;
|
||||
|
||||
class Controller implements CommunityServiceController
|
||||
{
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Attributes
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
private DynamicImplCommunityServiceController m_dobj;
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Constructor
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
Controller()
|
||||
{
|
||||
m_dobj = new DynamicImplCommunityServiceController(this);
|
||||
|
||||
} // 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 ComponentShutdown
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public void shutdown()
|
||||
{
|
||||
} // end shutdown
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Implementations from interface CommunityServiceController
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public String getDescription()
|
||||
{
|
||||
ResourceBundle b = ResourceBundle.getBundle("com.silverwrist.venice.conf.module.ModuleMessages");
|
||||
return b.getString("description");
|
||||
|
||||
} // end getDescription
|
||||
|
||||
public void addServiceToCommunity(Request req, VeniceCommunity comm)
|
||||
throws DatabaseException, CommunityServiceException
|
||||
{
|
||||
}
|
||||
|
||||
public void removeServiceFromCommunity(Request req, VeniceCommunity comm)
|
||||
throws DatabaseException, CommunityServiceException
|
||||
{
|
||||
}
|
||||
|
||||
} // end class Controller
|
||||
|
|
@ -0,0 +1,128 @@
|
|||
/*
|
||||
* 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.module;
|
||||
|
||||
import java.security.Principal;
|
||||
import java.util.*;
|
||||
import com.silverwrist.dynamo.except.*;
|
||||
import com.silverwrist.dynamo.iface.*;
|
||||
import com.silverwrist.dynamo.util.*;
|
||||
import com.silverwrist.venice.conf.ConfNamespaces;
|
||||
|
||||
public class ModuleMain implements ModuleFunctions
|
||||
{
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Static data members
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public static final String CONTROLLER_OBJNAME = "controller";
|
||||
|
||||
private static final QualifiedNameKey NAME =
|
||||
new QualifiedNameKey(ConfNamespaces.CONFERENCING_NAMESPACE,"Venice.conferencing");
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Attributes
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
private int m_usecount = 0;
|
||||
private ModuleSite m_site = null;
|
||||
private Controller m_controller = null;
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Constructor
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public ModuleMain()
|
||||
{ // do nothing
|
||||
} // end constructor
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Implementations from interface ModuleFunctions
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public QualifiedNameKey getModuleID()
|
||||
{
|
||||
return NAME;
|
||||
|
||||
} // end getModuleID
|
||||
|
||||
public String getDescription()
|
||||
{
|
||||
ResourceBundle b = ResourceBundle.getBundle("com.silverwrist.venice.conf.module.ModuleMessages");
|
||||
return b.getString("description");
|
||||
|
||||
} // end getDescription
|
||||
|
||||
public void initialize(ModuleSite site, ServiceProvider services) throws ModuleException
|
||||
{
|
||||
m_site = site;
|
||||
|
||||
} // end initialize
|
||||
|
||||
public void shutdown()
|
||||
{
|
||||
m_site = null;
|
||||
m_controller = null;
|
||||
m_usecount = 0;
|
||||
|
||||
} // end shutdown
|
||||
|
||||
public boolean inUse()
|
||||
{
|
||||
return (m_usecount>0);
|
||||
|
||||
} // end inUse
|
||||
|
||||
public boolean canInstall(ServiceProvider services, Principal installer)
|
||||
{
|
||||
return true; // TEMP
|
||||
}
|
||||
|
||||
public void install(ModuleSite site, ServiceProvider services, Principal installer, DynamoLog log)
|
||||
throws ModuleException
|
||||
{
|
||||
}
|
||||
|
||||
public void uninstall(ModuleSite site, ServiceProvider services, Principal uninstaller, DynamoLog log)
|
||||
throws ModuleException
|
||||
{
|
||||
}
|
||||
|
||||
public DynamicObject getProvidedObject(String namespace, String name) throws ModuleException
|
||||
{
|
||||
if (ConfNamespaces.CONFERENCING_NAMESPACE.equals(namespace) && CONTROLLER_OBJNAME.equals(name))
|
||||
{ // we want the community service controller
|
||||
synchronized (this)
|
||||
{ // create it if necessary
|
||||
if (m_controller==null)
|
||||
m_controller = new Controller();
|
||||
return m_controller;
|
||||
|
||||
} // end synchronized block
|
||||
|
||||
} // end if
|
||||
|
||||
return null;
|
||||
|
||||
} // end getProvidedObject
|
||||
|
||||
} // end class ModuleMain
|
|
@ -0,0 +1,18 @@
|
|||
# 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):
|
||||
# ---------------------------------------------------------------------------------
|
||||
# This file has been localized for the en_US locale
|
||||
description=Venice Conferencing System
|
|
@ -11,7 +11,7 @@
|
|||
*
|
||||
* 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) 2002 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
|
||||
* Copyright (C) 2002-03 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*/
|
||||
|
@ -49,7 +49,7 @@ public class CodeNotFoundException extends DynamicObjectException
|
|||
private String m_message = null;
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Constructor
|
||||
* Constructors
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
@ -114,7 +114,7 @@ public class CodeNotFoundException extends DynamicObjectException
|
|||
*/
|
||||
public String getLocalizedMessage(Locale locale)
|
||||
{
|
||||
ResourceBundle b = ResourceBundle.getBundle(BUNDLE,locale,getClass().getClassLoader());
|
||||
ResourceBundle b = ResourceBundle.getBundle(BUNDLE,locale,CodeNotFoundException.class.getClassLoader());
|
||||
return MessageFormat.format(b.getString(m_message_id),m_args);
|
||||
|
||||
} // end getLocalizedMessage
|
||||
|
|
|
@ -33,3 +33,5 @@ dialogException.xmlLoadException=Error in XML dialog definition: {0}
|
|||
udfe.bad.itemType=No implementation exists for dialog item type "{0}".
|
||||
htmlchecker.alreadyfinished=The HTML Checker is already in a finished state.
|
||||
htmlchecker.notyetfinished=The HTML Checker is not yet in a finished state.
|
||||
parameterCount=Invalid number of parameters to dynamic method "{0}" in class "{1}" (was {2}, should be {3})
|
||||
parameterType=Invalid type of parameter {2} in dynamic method "{0}," class "{1}" (was {3}, should be {4})
|
||||
|
|
|
@ -0,0 +1,105 @@
|
|||
/*
|
||||
* 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.dynamo.except;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.Locale;
|
||||
import java.util.ResourceBundle;
|
||||
import com.silverwrist.dynamo.iface.DynamicClass;
|
||||
|
||||
public class ParameterCountException extends DynamicObjectRuntimeException
|
||||
{
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Static data members
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
private static final String BUNDLE = "com.silverwrist.dynamo.except.DynamoExceptionMessages";
|
||||
private static final String MESSAGE = "parameterCount";
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Attributes
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
private String[] m_args;
|
||||
private String m_message = null;
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Constructor
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public ParameterCountException(DynamicClass dclass, String method_name, int desired_length, int actual_length)
|
||||
{
|
||||
super("");
|
||||
m_args = new String[4];
|
||||
m_args[0] = dclass.getName();
|
||||
m_args[1] = method_name;
|
||||
m_args[2] = String.valueOf(desired_length);
|
||||
m_args[3] = String.valueOf(actual_length);
|
||||
|
||||
} // end constructor
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Overrides from class Throwable
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public String getMessage()
|
||||
{
|
||||
if (m_message==null)
|
||||
m_message = getLocalizedMessage(Locale.US);
|
||||
return m_message;
|
||||
|
||||
} // end getMessage
|
||||
|
||||
/**
|
||||
* Creates a localized description of this exception. Subclasses may override this method in
|
||||
* order to produce a locale-specific message. For subclasses that do not override this method,
|
||||
* the default implementation returns the same result as <CODE>getMessage()</CODE>.
|
||||
*
|
||||
* @return The localized description of this exception.
|
||||
*/
|
||||
public String getLocalizedMessage()
|
||||
{
|
||||
return this.getLocalizedMessage(Locale.getDefault());
|
||||
|
||||
} // end getLocalizedMessage
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Overrides from class DynamoRuntimeException
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/**
|
||||
* Creates a localized description of this exception. Subclasses may override this method in
|
||||
* order to produce a locale-specific message. For subclasses that do not override this method,
|
||||
* the default implementation returns the same result as <CODE>getLocalizedMessage()</CODE>.
|
||||
*
|
||||
* @param locale The locale to render the message in.
|
||||
* @return The localized description of this exception.
|
||||
*/
|
||||
public String getLocalizedMessage(Locale locale)
|
||||
{
|
||||
ResourceBundle b = ResourceBundle.getBundle(BUNDLE,locale,ParameterCountException.class.getClassLoader());
|
||||
return MessageFormat.format(b.getString(MESSAGE),m_args);
|
||||
|
||||
} // end getLocalizedMessage
|
||||
|
||||
} // end class ParameterCountException
|
|
@ -0,0 +1,106 @@
|
|||
/*
|
||||
* 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.dynamo.except;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.Locale;
|
||||
import java.util.ResourceBundle;
|
||||
import com.silverwrist.dynamo.iface.DynamicClass;
|
||||
|
||||
public class ParameterTypeException extends DynamicObjectRuntimeException
|
||||
{
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Static data members
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
private static final String BUNDLE = "com.silverwrist.dynamo.except.DynamoExceptionMessages";
|
||||
private static final String MESSAGE = "parameterType";
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Attributes
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
private String[] m_args;
|
||||
private String m_message = null;
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Constructor
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public ParameterTypeException(DynamicClass dclass, String method_name, int index, Class desired, Class actual)
|
||||
{
|
||||
super("");
|
||||
m_args = new String[5];
|
||||
m_args[0] = dclass.getName();
|
||||
m_args[1] = method_name;
|
||||
m_args[2] = String.valueOf(index);
|
||||
m_args[3] = desired.getName();
|
||||
m_args[4] = actual.getName();
|
||||
|
||||
} // end constructor
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Overrides from class Throwable
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public String getMessage()
|
||||
{
|
||||
if (m_message==null)
|
||||
m_message = getLocalizedMessage(Locale.US);
|
||||
return m_message;
|
||||
|
||||
} // end getMessage
|
||||
|
||||
/**
|
||||
* Creates a localized description of this exception. Subclasses may override this method in
|
||||
* order to produce a locale-specific message. For subclasses that do not override this method,
|
||||
* the default implementation returns the same result as <CODE>getMessage()</CODE>.
|
||||
*
|
||||
* @return The localized description of this exception.
|
||||
*/
|
||||
public String getLocalizedMessage()
|
||||
{
|
||||
return this.getLocalizedMessage(Locale.getDefault());
|
||||
|
||||
} // end getLocalizedMessage
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Overrides from class DynamoRuntimeException
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/**
|
||||
* Creates a localized description of this exception. Subclasses may override this method in
|
||||
* order to produce a locale-specific message. For subclasses that do not override this method,
|
||||
* the default implementation returns the same result as <CODE>getLocalizedMessage()</CODE>.
|
||||
*
|
||||
* @param locale The locale to render the message in.
|
||||
* @return The localized description of this exception.
|
||||
*/
|
||||
public String getLocalizedMessage(Locale locale)
|
||||
{
|
||||
ResourceBundle b = ResourceBundle.getBundle(BUNDLE,locale,ParameterTypeException.class.getClassLoader());
|
||||
return MessageFormat.format(b.getString(MESSAGE),m_args);
|
||||
|
||||
} // end getLocalizedMessage
|
||||
|
||||
} // end class DynamicObjectRuntimeException
|
|
@ -0,0 +1,90 @@
|
|||
/*
|
||||
* 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.dynamo.obj;
|
||||
|
||||
import java.util.*;
|
||||
import com.silverwrist.dynamo.except.*;
|
||||
import com.silverwrist.dynamo.iface.*;
|
||||
|
||||
public class DynamicClassImpl implements DynamicClass
|
||||
{
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Attributes
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
private String m_name;
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Constructor
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
protected DynamicClassImpl(String name)
|
||||
{
|
||||
m_name = name;
|
||||
|
||||
} // end constructor
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Implementations from class NamedObject
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return m_name;
|
||||
|
||||
} // end getName
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Implementations from class DynamicClass
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public Object get(String property_name) throws DynamicObjectException
|
||||
{
|
||||
throw new CodeNotFoundException(this,CodeNotFoundException.GET,property_name);
|
||||
|
||||
} // end get
|
||||
|
||||
public void set(String property_name, Object value) throws DynamicObjectException
|
||||
{
|
||||
throw new CodeNotFoundException(this,CodeNotFoundException.SET,property_name);
|
||||
|
||||
} // end set
|
||||
|
||||
public Object call(String method_name, Object[] parameters) throws DynamicObjectException
|
||||
{
|
||||
throw new CodeNotFoundException(this,CodeNotFoundException.CALL,method_name);
|
||||
|
||||
} // end call
|
||||
|
||||
public Object call(String method_name, List parameters) throws DynamicObjectException
|
||||
{
|
||||
throw new CodeNotFoundException(this,CodeNotFoundException.CALL,method_name);
|
||||
|
||||
} // end call
|
||||
|
||||
public DynamicObject cast(Object source) throws ClassCastException
|
||||
{
|
||||
throw new ClassCastException("DynamicClassImpl.cast(): invalid cast");
|
||||
|
||||
} // end class
|
||||
|
||||
} // end class DynamicClassImpl
|
|
@ -0,0 +1,103 @@
|
|||
/*
|
||||
* 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.dynamo.obj;
|
||||
|
||||
import java.util.*;
|
||||
import com.silverwrist.dynamo.except.*;
|
||||
import com.silverwrist.dynamo.iface.*;
|
||||
|
||||
public class DynamicObjectImpl implements DynamicObject
|
||||
{
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Attributes
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
private DynamicClass m_dclass;
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Constructor
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
protected DynamicObjectImpl(DynamicClass dclass)
|
||||
{
|
||||
m_dclass = dclass;
|
||||
|
||||
} // end constructor
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Internal operations
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
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);
|
||||
|
||||
} // end verifyParameterLength
|
||||
|
||||
protected final void verifyParameterType(String method_name, Object[] parameters, int ndx, Class klass)
|
||||
{
|
||||
if (parameters[ndx]==null)
|
||||
return;
|
||||
if (!(klass.isInstance(parameters[ndx])))
|
||||
throw new ParameterTypeException(m_dclass,method_name,ndx,klass,parameters[ndx].getClass());
|
||||
|
||||
} // end verifyParameterType
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Implementations from interface DynamicObject
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public Object get(String property_name) throws DynamicObjectException
|
||||
{
|
||||
throw new CodeNotFoundException(m_dclass,CodeNotFoundException.GET,property_name);
|
||||
|
||||
} // end get
|
||||
|
||||
public void set(String property_name, Object value) throws DynamicObjectException
|
||||
{
|
||||
throw new CodeNotFoundException(m_dclass,CodeNotFoundException.SET,property_name);
|
||||
|
||||
} // end set
|
||||
|
||||
public Object call(String method_name, Object[] parameters) throws DynamicObjectException
|
||||
{
|
||||
throw new CodeNotFoundException(m_dclass,CodeNotFoundException.CALL,method_name);
|
||||
|
||||
} // end call
|
||||
|
||||
public Object call(String method_name, List parameters) throws DynamicObjectException
|
||||
{
|
||||
Object[] parray = new Object[parameters.size()];
|
||||
if (parray.length>0)
|
||||
parameters.toArray(parray);
|
||||
return call(method_name,parray);
|
||||
|
||||
} // end call
|
||||
|
||||
public DynamicClass getDClass()
|
||||
{
|
||||
return m_dclass;
|
||||
|
||||
} // end getDClass
|
||||
|
||||
} // end class DynamicObjectImpl
|
|
@ -0,0 +1,51 @@
|
|||
/*
|
||||
* 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.obj;
|
||||
|
||||
import com.silverwrist.dynamo.except.*;
|
||||
import com.silverwrist.dynamo.iface.*;
|
||||
import com.silverwrist.dynamo.obj.*;
|
||||
import com.silverwrist.venice.iface.*;
|
||||
|
||||
class DynamicClassCommunityServiceController extends DynamicClassImpl
|
||||
{
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Constructor
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
DynamicClassCommunityServiceController()
|
||||
{
|
||||
super("Dynamic." + CommunityServiceController.class.getName());
|
||||
|
||||
} // end constructor
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Overrides from class DynamicClassImpl
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public DynamicObject cast(Object source) throws ClassCastException
|
||||
{
|
||||
if (source instanceof CommunityServiceController)
|
||||
return (DynamicObject)source;
|
||||
return super.cast(source);
|
||||
|
||||
} // end cast
|
||||
|
||||
} // end class DynamicClassCommunityServiceController
|
|
@ -0,0 +1,104 @@
|
|||
/*
|
||||
* 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.obj;
|
||||
|
||||
import com.silverwrist.dynamo.except.*;
|
||||
import com.silverwrist.dynamo.iface.*;
|
||||
import com.silverwrist.dynamo.obj.*;
|
||||
import com.silverwrist.venice.iface.*;
|
||||
|
||||
public class DynamicImplCommunityServiceController extends DynamicObjectImpl
|
||||
{
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Static data members
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
private static DynamicClass s_baseclass = null;
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Attributes
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
private CommunityServiceController m_impl;
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Constructors
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public DynamicImplCommunityServiceController(CommunityServiceController impl)
|
||||
{
|
||||
super(getBaseDClass());
|
||||
m_impl = impl;
|
||||
|
||||
} // end constructor
|
||||
|
||||
public DynamicImplCommunityServiceController(CommunityServiceController impl, DynamicClass dclass)
|
||||
{
|
||||
super(dclass);
|
||||
m_impl = impl;
|
||||
|
||||
} // end constructor
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Overrides from class DynamicObjectImpl
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public Object get(String property_name) throws DynamicObjectException
|
||||
{
|
||||
if (property_name.equals("description"))
|
||||
return m_impl.getDescription();
|
||||
return super.get(property_name);
|
||||
|
||||
} // end get
|
||||
|
||||
public Object call(String method_name, Object[] parameters) throws DynamicObjectException
|
||||
{
|
||||
// N.B.: "shutdown" should NOT be a dynamic call
|
||||
|
||||
if (method_name.equals("getDescription"))
|
||||
{ // call getDescription
|
||||
verifyParameterLength(method_name,parameters,0);
|
||||
return m_impl.getDescription();
|
||||
|
||||
} // end if
|
||||
|
||||
// N.B.: "addServiceToCommunity" should NOT be a dynamic call
|
||||
// N.B.: "removeServiceFromCommunity" should NOT be a dynamic call
|
||||
|
||||
return super.call(method_name,parameters);
|
||||
|
||||
} // end call
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* External static operations
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public static synchronized DynamicClass getBaseDClass()
|
||||
{
|
||||
if (s_baseclass==null)
|
||||
s_baseclass = new DynamicClassCommunityServiceController();
|
||||
return s_baseclass;
|
||||
|
||||
} // end getBaseDClass
|
||||
|
||||
} // end class DynamicImplCommunityServiceController
|
Loading…
Reference in New Issue
Block a user