Permalink
Browse files

intermediate commit

  • Loading branch information...
1 parent 62eb8e6 commit 68bf3af006acb2ae2252f7113cf69cb951359c00 @grze grze committed Aug 14, 2009
Showing with 497 additions and 223 deletions.
  1. +21 −15 clc/.classpath
  2. +4 −1 clc/build.xml
  3. +3 −1 clc/modules/authentication/src/main/java/com/eucalyptus/auth/CredentialsBootstrapper.java
  4. +2 −2 clc/modules/bootstrap/arguments.ggo
  5. +1 −1 clc/modules/bootstrap/eucalyptus-bootstrap.c
  6. +37 −15 clc/modules/bootstrap/eucalyptus-opts.c
  7. +6 −2 clc/modules/bootstrap/eucalyptus-opts.h
  8. +2 −1 clc/modules/cloud/src/main/java/com/eucalyptus/bootstrap/HsqldbBootstrapper.java
  9. +0 −8 clc/modules/cloud/src/main/resources/META-INF/eucalyptus-bootstrap.properties
  10. +0 −45 clc/modules/cloud/src/main/resources/META-INF/eucalyptus-services.xml
  11. +6 −1 clc/modules/cloud/src/main/resources/com.eucalyptus.CloudServiceProvider
  12. 0 clc/modules/cloud/src/main/resources/{META-INF → }/eucalyptus-cloud-model.xml
  13. 0 clc/modules/cloud/src/main/resources/{META-INF → }/eucalyptus-cloud-services.xml
  14. +1 −1 clc/modules/cloud/src/main/resources/{META-INF → }/eucalyptus-interface.xml
  15. 0 clc/modules/cloud/src/main/resources/{META-INF → }/eucalyptus-mule.xml
  16. 0 clc/modules/cloud/src/main/resources/{META-INF → }/eucalyptus-runtime.xml
  17. 0 clc/modules/cloud/src/main/resources/{META-INF → }/eucalyptus-storage.xml
  18. 0 clc/modules/cloud/src/main/resources/{META-INF → }/eucalyptus-userdata.xml
  19. 0 clc/modules/cloud/src/main/resources/{META-INF → }/eucalyptus-verification.xml
  20. +7 −4 clc/modules/core/src/main/resources/log4j.xml
  21. +55 −33 clc/modules/msgs/src/main/java/com/eucalyptus/bootstrap/BootstrapFactory.java
  22. +2 −4 clc/modules/msgs/src/main/java/com/eucalyptus/bootstrap/Bootstrapper.java
  23. +12 −0 clc/modules/msgs/src/main/java/com/eucalyptus/bootstrap/Depends.java
  24. +12 −0 clc/modules/msgs/src/main/java/com/eucalyptus/bootstrap/Provides.java
  25. +66 −0 clc/modules/msgs/src/main/java/com/eucalyptus/bootstrap/Resource.java
  26. +60 −0 clc/modules/msgs/src/main/java/com/eucalyptus/bootstrap/ResourceProvider.java
  27. +28 −53 clc/modules/msgs/src/main/java/com/eucalyptus/bootstrap/SystemBootstrapper.java
  28. +53 −0 clc/modules/msgs/src/main/java/com/eucalyptus/util/EucaLayout.java
  29. +17 −0 clc/modules/msgs/src/main/java/com/eucalyptus/util/LogUtils.java
  30. +12 −31 clc/modules/msgs/src/main/java/com/eucalyptus/util/ServiceJarFile.java
  31. +87 −2 clc/modules/msgs/src/main/resources/eucalyptus-bootstrap.xml
  32. +1 −1 clc/modules/storage-controller/src/main/resources/com.eucalyptus.CloudServiceProvider
  33. +1 −1 clc/modules/storage-manager/src/main/resources/com.eucalyptus.CloudServiceProvider
  34. +1 −1 ...ain/java/edu/ucsb/eucalyptus/ic → wsstack/src/main/java/com/eucalyptus/ws/util}/RequestQueue.java
View
36 clc/.classpath
@@ -11,11 +11,11 @@
<classpathentry kind="src" output="modules/storage-controller/build" path="modules/storage-controller/src/main/java"/>
<classpathentry kind="src" output="modules/dns/build" path="modules/dns/src/main/java"/>
<classpathentry kind="src" output="modules/storage-manager/build" path="modules/storage-manager/src/main/java"/>
- <classpathentry kind="src" output="modules/workarounds/build" path="modules/workarounds/src/main/java"/>
- <classpathentry kind="src" output="modules/crypto/build" path="modules/crypto/src/main/java"/>
<classpathentry kind="src" output="modules/authentication/build" path="modules/authentication/src/main/java"/>
<classpathentry kind="src" output="modules/www/build" path="modules/www/src/main/java"/>
<classpathentry kind="src" output="modules/cloud/build" path="modules/cloud/src/main/java"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="GROOVY_SUPPORT"/>
<classpathentry kind="lib" path="lib/ant-1.7.jar"/>
<classpathentry kind="lib" path="lib/antlr3-3.0.1+dfsg.jar"/>
<classpathentry kind="lib" path="lib/antlrall.jar"/>
@@ -56,14 +56,14 @@
<classpathentry kind="lib" path="lib/geronimo-activation-1.1-spec-1.0.1.jar"/>
<classpathentry kind="lib" path="lib/geronimo-ejb-3.0-spec-1.0.1.jar"/>
<classpathentry kind="lib" path="lib/geronimo-j2ee-connector-1.5-spec-1.1.jar"/>
- <classpathentry kind="lib" path="lib/geronimo-javamail-1.4-provider-1.6.jar"/>
- <classpathentry kind="lib" path="lib/geronimo-javamail-1.4-spec-1.2.jar"/>
<classpathentry kind="lib" path="lib/geronimo-jms-1.1-spec-1.1.jar"/>
<classpathentry kind="lib" path="lib/geronimo-jpa-3.0-spec-1.1.1.jar"/>
<classpathentry kind="lib" path="lib/geronimo-jta-1.0.1b-spec-1.1.jar"/>
<classpathentry kind="lib" path="lib/geronimo-stax-1.0-spec-1.0.1.jar"/>
+ <classpathentry kind="lib" path="lib/gnumail-providers.jar"/>
+ <classpathentry kind="lib" path="lib/gnumail.jar"/>
<classpathentry kind="lib" path="lib/google-collect-20080808.jar"/>
- <classpathentry kind="lib" path="lib/groovy.jar"/>
+ <classpathentry kind="lib" path="lib/groovy-1.6.3.jar"/>
<classpathentry kind="lib" path="lib/gwt-dev-linux-1.6.4.jar"/>
<classpathentry kind="lib" path="lib/gwt-servlet-1.6.4.jar"/>
<classpathentry kind="lib" path="lib/gwt-user-1.6.4.jar"/>
@@ -73,17 +73,24 @@
<classpathentry kind="lib" path="lib/hibernate-commons-annotations-3.0.0.GA+euca1.jar"/>
<classpathentry kind="lib" path="lib/hibernate-connection-c3p0-3.3.1+euca1.jar"/>
<classpathentry kind="lib" path="lib/hibernate-entitymanager-3.4.0.GA+euca1.jar"/>
- <classpathentry kind="lib" path="lib/hsqldb-1.8.0.10.jar" sourcepath="/home/decker/jbproject/hsqldb-1.8.0.10"/>
+ <classpathentry kind="lib" path="lib/hsqldb-1.8.0.10.jar"/>
<classpathentry kind="lib" path="lib/hsqldbutil-1.8.0.10.jar"/>
<classpathentry kind="lib" path="lib/janino-2.5.15-1.jar"/>
<classpathentry kind="lib" path="lib/javassist-3.8.1.jar"/>
<classpathentry kind="lib" path="lib/jaxen-1.1.1.jar"/>
<classpathentry kind="lib" path="lib/jaxp-1.3.jar"/>
<classpathentry kind="lib" path="lib/jcl-over-slf4j-1.5.2.jar"/>
<classpathentry kind="lib" path="lib/jettison-1.0.jar"/>
- <classpathentry kind="lib" path="lib/jetty-6.1.18.jar"/>
- <classpathentry kind="lib" path="lib/jetty-sslengine-6.1.18.jar"/>
- <classpathentry kind="lib" path="lib/jetty-util-6.1.18.jar"/>
+ <classpathentry kind="lib" path="lib/jetty6-6.1.19.jar"/>
+ <classpathentry kind="lib" path="lib/jetty6-ajp-6.1.19.jar"/>
+ <classpathentry kind="lib" path="lib/jetty6-client-6.1.19.jar"/>
+ <classpathentry kind="lib" path="lib/jetty6-html-6.1.19.jar"/>
+ <classpathentry kind="lib" path="lib/jetty6-management-6.1.19.jar"/>
+ <classpathentry kind="lib" path="lib/jetty6-naming-6.1.19.jar"/>
+ <classpathentry kind="lib" path="lib/jetty6-rewrite-handler-6.1.19.jar"/>
+ <classpathentry kind="lib" path="lib/jetty6-servlet-tester-6.1.19.jar"/>
+ <classpathentry kind="lib" path="lib/jetty6-sslengine-6.1.19.jar"/>
+ <classpathentry kind="lib" path="lib/jetty6-util-6.1.19.jar"/>
<classpathentry kind="lib" path="lib/jibx-bind-1.1.6a.jar"/>
<classpathentry kind="lib" path="lib/jibx-extras-1.1.6a.jar"/>
<classpathentry kind="lib" path="lib/jibx-run-1.1.6a.jar"/>
@@ -92,14 +99,15 @@
<classpathentry kind="lib" path="lib/jul-to-slf4j-1.5.2.jar"/>
<classpathentry kind="lib" path="lib/junit-3.8.2.jar"/>
<classpathentry kind="lib" path="lib/log4j-1.2.15.jar"/>
- <classpathentry kind="lib" path="lib/mule-core-2.0.1+euca1.jar" sourcepath="/home/decker/jbproject/mule-2.0.1/src"/>
+ <classpathentry kind="lib" path="lib/mule-core-2.0.1+euca1.jar"/>
<classpathentry kind="lib" path="lib/mule-module-builders-2.0.1+euca1.jar"/>
<classpathentry kind="lib" path="lib/mule-module-client-2.0.1+euca1.jar"/>
- <classpathentry kind="lib" path="lib/mule-module-spring-config-2.0.1+euca1.jar" sourcepath="/home/decker/jbproject/mule-2.0.1/src"/>
+ <classpathentry kind="lib" path="lib/mule-module-spring-config-2.0.1+euca1.jar"/>
<classpathentry kind="lib" path="lib/mule-module-xml-2.0.1+euca1.jar"/>
<classpathentry kind="lib" path="lib/mule-transport-vm-2.0.1.jar"/>
<classpathentry kind="lib" path="lib/mvel-1.3.14.jar"/>
- <classpathentry kind="lib" path="lib/netty-3.1.0.CR1.jar" sourcepath="/home/decker/jbproject/netty-3.1.0.CR1/src/main/java"/>
+ <classpathentry kind="lib" path="lib/netty-3.1.0.CR1.jar"/>
+ <classpathentry kind="lib" path="lib/openjdk-crypto.jar"/>
<classpathentry kind="lib" path="lib/regexp-1.4.jar"/>
<classpathentry kind="lib" path="lib/serializer.jar"/>
<classpathentry kind="lib" path="lib/servlet-api-2.5.jar"/>
@@ -111,13 +119,11 @@
<classpathentry kind="lib" path="lib/spring-core-2.5.6.SEC01+euca1.jar"/>
<classpathentry kind="lib" path="lib/spring-web-2.5.6.SEC01+euca1.jar"/>
<classpathentry kind="lib" path="lib/wsdl4j-1.6.2.jar"/>
- <classpathentry kind="lib" path="lib/wss4j-1.5.7.jar" sourcepath="/home/decker/jbproject/wss4j-src-svn/src"/>
+ <classpathentry kind="lib" path="lib/wss4j-1.5.7.jar"/>
<classpathentry kind="lib" path="lib/xalan2.jar"/>
<classpathentry kind="lib" path="lib/xercesImpl.jar"/>
<classpathentry kind="lib" path="lib/xml-security-1.4.2.jar"/>
<classpathentry kind="lib" path="lib/xom-1.1.jar"/>
<classpathentry kind="lib" path="lib/xpp3-1.1.3.4.O.jar"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="con" path="GROOVY_SUPPORT"/>
<classpathentry kind="output" path="bin"/>
</classpath>
View
5 clc/build.xml
@@ -116,6 +116,7 @@
<target name="clean-walrus" depends="clean-walrus-ws"/>
<target name="clean-ebs" depends="clean-ebs-ws"/>
<target name="clean-dns" depends="clean-dns-ws"/>
+ <target name="clean-nogwt" depends="clean-core,clean-www,clean-eucalyptus-ws,clean-walrus,clean-ebs,clean-dns"/>
<target name="clean" depends="clean-eucalyptus,clean-walrus,clean-ebs,clean-dns">
<delete dir="${target.dir}"/>
</target>
@@ -126,6 +127,9 @@
</target>
<!--================================== install target ==================================-->
<target name="install" depends="build">
+ <ant dir="modules/www" inheritall="false" target="install"/>
+ </target>
+ <target name="install-nogwt" depends="build-nogwt">
<!-- copy libraries over -->
<mkdir dir="${euca.lib.dir}"/>
<copy todir="${euca.lib.dir}">
@@ -153,7 +157,6 @@
<ant dir="modules/authentication" inheritall="false" target="install"/>
<ant dir="modules/core" inheritall="false" target="install"/>
<ant dir="modules/wsstack" inheritall="false" target="install"/>
- <ant dir="modules/www" inheritall="false" target="install"/>
<ant dir="modules/interface" inheritall="false" target="install"/>
<ant dir="modules/cluster-manager" inheritall="false" target="install"/>
<ant dir="modules/image-manager" inheritall="false" target="install"/>
View
4 clc/modules/authentication/src/main/java/com/eucalyptus/auth/CredentialsBootstrapper.java
@@ -4,7 +4,9 @@
import com.eucalyptus.auth.util.EucaKeyStore;
import com.eucalyptus.bootstrap.Bootstrapper;
-
+import com.eucalyptus.bootstrap.Provides;
+import com.eucalyptus.bootstrap.Resource;
+@Provides(resource=Resource.SystemCredentials)
public class CredentialsBootstrapper extends Bootstrapper {
private static Logger LOG = Logger.getLogger( CredentialsBootstrapper.class );
@Override
View
4 clc/modules/bootstrap/arguments.ggo
@@ -5,8 +5,8 @@ section "Eucalyptus Configuration & Environment"
option "user" u "User to drop privs to after starting." string typestr="username" default="eucalyptus" no
option "home" h "Eucalyptus home directory." string typestr="directory" default="/" no
option "define" D "Set system properties." string optional multiple
-option "bootstrap-config" c "Use this file as the configuration for early runtime service bootstrapping." string typestr="config.xml" default="eucalyptus-bootstrap.xml" no
-option "verbose" v "Verbose console output. Note: log file output is not controlled by this flag." flag off
+option "verbose" v "Verbose bootstrapper output. Note: This only controls the level of output from the native bootstrapper." flag off
+option "log-level" l "Control the log level for console output." string typestr="filename" default="INFO" no
option "out" o "Redirect standard out to file." string typestr="filename" default="&1" no
option "err" e "Redirect standard error to file." string typestr="filename" default="&2" no
View
2 clc/modules/bootstrap/eucalyptus-bootstrap.c
@@ -503,7 +503,7 @@ int java_init(euca_opts *args, java_home_t *data) {
int x = -1, i;
opt=(JavaVMOption *)malloc(JVM_MAX_OPTS*sizeof(JavaVMOption));
for(i=0;i<JVM_MAX_OPTS;i++) opt[i].extraInfo=NULL;
- JVM_ARG(opt[++x],"-Deuca.bootstrap.config=%1$s",GETARG(args,bootstrap_config));
+ JVM_ARG(opt[++x],"-Deuca.log.level=%1$s",GETARG(args,log_level));
if(args->debug_flag) {
JVM_ARG(opt[++x],"-Xdebug");
JVM_ARG(opt[++x],"-Xrunjdwp:transport=dt_socket,server=y,suspend=%2$s,address=%1$d",GETARG(args,debug_port),(args->debug_suspend_flag?"y":"n"));
View
52 clc/modules/bootstrap/eucalyptus-opts.c
@@ -35,7 +35,8 @@ const char *eucalyptus_opts_help[] = {
" -h, --home=directory Eucalyptus home directory. (default=`/')",
" -D, --define=STRING Set system properties.",
" -c, --bootstrap-config=config.xml\n Use this file as the configuration for early \n runtime service bootstrapping. \n (default=`eucalyptus-bootstrap.xml')",
- " -v, --verbose Verbose console output. Note: log file output \n is not controlled by this flag. \n (default=off)",
+ " -v, --verbose Verbose bootstrapper output. Note: This only \n controls the level of output from the native \n bootstrapper. (default=off)",
+ " -l, --log-level=filename Control the log level for console output. \n (default=`INFO')",
" -o, --out=filename Redirect standard out to file. (default=`&1')",
" -e, --err=filename Redirect standard error to file. \n (default=`&2')",
"\nEucalyptus Runtime Options:",
@@ -84,6 +85,7 @@ void clear_given (struct eucalyptus_opts *args_info)
args_info->define_given = 0 ;
args_info->bootstrap_config_given = 0 ;
args_info->verbose_given = 0 ;
+ args_info->log_level_given = 0 ;
args_info->out_given = 0 ;
args_info->err_given = 0 ;
args_info->check_given = 0 ;
@@ -110,6 +112,8 @@ void clear_args (struct eucalyptus_opts *args_info)
args_info->bootstrap_config_arg = gengetopt_strdup ("eucalyptus-bootstrap.xml");
args_info->bootstrap_config_orig = NULL;
args_info->verbose_flag = 0;
+ args_info->log_level_arg = gengetopt_strdup ("INFO");
+ args_info->log_level_orig = NULL;
args_info->out_arg = gengetopt_strdup ("&1");
args_info->out_orig = NULL;
args_info->err_arg = gengetopt_strdup ("&2");
@@ -146,20 +150,21 @@ void init_args_info(struct eucalyptus_opts *args_info)
args_info->define_max = 0;
args_info->bootstrap_config_help = eucalyptus_opts_help[6] ;
args_info->verbose_help = eucalyptus_opts_help[7] ;
- args_info->out_help = eucalyptus_opts_help[8] ;
- args_info->err_help = eucalyptus_opts_help[9] ;
- args_info->check_help = eucalyptus_opts_help[11] ;
- args_info->stop_help = eucalyptus_opts_help[12] ;
- args_info->fork_help = eucalyptus_opts_help[13] ;
- args_info->pidfile_help = eucalyptus_opts_help[14] ;
- args_info->java_home_help = eucalyptus_opts_help[16] ;
- args_info->jvm_name_help = eucalyptus_opts_help[17] ;
- args_info->jvm_args_help = eucalyptus_opts_help[18] ;
+ args_info->log_level_help = eucalyptus_opts_help[8] ;
+ args_info->out_help = eucalyptus_opts_help[9] ;
+ args_info->err_help = eucalyptus_opts_help[10] ;
+ args_info->check_help = eucalyptus_opts_help[12] ;
+ args_info->stop_help = eucalyptus_opts_help[13] ;
+ args_info->fork_help = eucalyptus_opts_help[14] ;
+ args_info->pidfile_help = eucalyptus_opts_help[15] ;
+ args_info->java_home_help = eucalyptus_opts_help[17] ;
+ args_info->jvm_name_help = eucalyptus_opts_help[18] ;
+ args_info->jvm_args_help = eucalyptus_opts_help[19] ;
args_info->jvm_args_min = 0;
args_info->jvm_args_max = 0;
- args_info->debug_help = eucalyptus_opts_help[19] ;
- args_info->debug_port_help = eucalyptus_opts_help[20] ;
- args_info->debug_suspend_help = eucalyptus_opts_help[21] ;
+ args_info->debug_help = eucalyptus_opts_help[20] ;
+ args_info->debug_port_help = eucalyptus_opts_help[21] ;
+ args_info->debug_suspend_help = eucalyptus_opts_help[22] ;
}
@@ -289,6 +294,8 @@ arguments_release (struct eucalyptus_opts *args_info)
free_multiple_string_field (args_info->define_given, &(args_info->define_arg), &(args_info->define_orig));
free_string_field (&(args_info->bootstrap_config_arg));
free_string_field (&(args_info->bootstrap_config_orig));
+ free_string_field (&(args_info->log_level_arg));
+ free_string_field (&(args_info->log_level_orig));
free_string_field (&(args_info->out_arg));
free_string_field (&(args_info->out_orig));
free_string_field (&(args_info->err_arg));
@@ -351,6 +358,8 @@ arguments_dump(FILE *outfile, struct eucalyptus_opts *args_info)
write_into_file(outfile, "bootstrap-config", args_info->bootstrap_config_orig, 0);
if (args_info->verbose_given)
write_into_file(outfile, "verbose", 0, 0 );
+ if (args_info->log_level_given)
+ write_into_file(outfile, "log-level", args_info->log_level_orig, 0);
if (args_info->out_given)
write_into_file(outfile, "out", args_info->out_orig, 0);
if (args_info->err_given)
@@ -933,6 +942,7 @@ arguments_internal (int argc, char * const *argv, struct eucalyptus_opts *args_i
{ "define", 1, NULL, 'D' },
{ "bootstrap-config", 1, NULL, 'c' },
{ "verbose", 0, NULL, 'v' },
+ { "log-level", 1, NULL, 'l' },
{ "out", 1, NULL, 'o' },
{ "err", 1, NULL, 'e' },
{ "check", 0, NULL, 'C' },
@@ -948,7 +958,7 @@ arguments_internal (int argc, char * const *argv, struct eucalyptus_opts *args_i
{ NULL, 0, NULL, 0 }
};
- c = getopt_long (argc, argv, "Vu:h:D:c:vo:e:CSfj:J:X:d", long_options, &option_index);
+ c = getopt_long (argc, argv, "Vu:h:D:c:vl:o:e:CSfj:J:X:d", long_options, &option_index);
if (c == -1) break; /* Exit from `while (1)' loop. */
@@ -1004,7 +1014,7 @@ arguments_internal (int argc, char * const *argv, struct eucalyptus_opts *args_i
goto failure;
break;
- case 'v': /* Verbose console output. Note: log file output is not controlled by this flag.. */
+ case 'v': /* Verbose bootstrapper output. Note: This only controls the level of output from the native bootstrapper.. */
if (update_arg((void *)&(args_info->verbose_flag), 0, &(args_info->verbose_given),
@@ -1014,6 +1024,18 @@ arguments_internal (int argc, char * const *argv, struct eucalyptus_opts *args_i
goto failure;
break;
+ case 'l': /* Control the log level for console output.. */
+
+
+ if (update_arg( (void *)&(args_info->log_level_arg),
+ &(args_info->log_level_orig), &(args_info->log_level_given),
+ &(local_args_info.log_level_given), optarg, 0, "INFO", ARG_STRING,
+ check_ambiguity, override, 0, 0,
+ "log-level", 'l',
+ additional_error))
+ goto failure;
+
+ break;
case 'o': /* Redirect standard out to file.. */
View
8 clc/modules/bootstrap/eucalyptus-opts.h
@@ -48,8 +48,11 @@ struct eucalyptus_opts
char * bootstrap_config_arg; /**< @brief Use this file as the configuration for early runtime service bootstrapping. (default='eucalyptus-bootstrap.xml'). */
char * bootstrap_config_orig; /**< @brief Use this file as the configuration for early runtime service bootstrapping. original value given at command line. */
const char *bootstrap_config_help; /**< @brief Use this file as the configuration for early runtime service bootstrapping. help description. */
- int verbose_flag; /**< @brief Verbose console output. Note: log file output is not controlled by this flag. (default=off). */
- const char *verbose_help; /**< @brief Verbose console output. Note: log file output is not controlled by this flag. help description. */
+ int verbose_flag; /**< @brief Verbose bootstrapper output. Note: This only controls the level of output from the native bootstrapper. (default=off). */
+ const char *verbose_help; /**< @brief Verbose bootstrapper output. Note: This only controls the level of output from the native bootstrapper. help description. */
+ char * log_level_arg; /**< @brief Control the log level for console output. (default='INFO'). */
+ char * log_level_orig; /**< @brief Control the log level for console output. original value given at command line. */
+ const char *log_level_help; /**< @brief Control the log level for console output. help description. */
char * out_arg; /**< @brief Redirect standard out to file. (default='&1'). */
char * out_orig; /**< @brief Redirect standard out to file. original value given at command line. */
const char *out_help; /**< @brief Redirect standard out to file. help description. */
@@ -91,6 +94,7 @@ struct eucalyptus_opts
unsigned int define_given ; /**< @brief Whether define was given. */
unsigned int bootstrap_config_given ; /**< @brief Whether bootstrap-config was given. */
unsigned int verbose_given ; /**< @brief Whether verbose was given. */
+ unsigned int log_level_given ; /**< @brief Whether log-level was given. */
unsigned int out_given ; /**< @brief Whether out was given. */
unsigned int err_given ; /**< @brief Whether err was given. */
unsigned int check_given ; /**< @brief Whether check was given. */
View
3 clc/modules/cloud/src/main/java/com/eucalyptus/bootstrap/HsqldbBootstrapper.java
@@ -11,7 +11,8 @@
import com.eucalyptus.bootstrap.Bootstrapper;
import com.eucalyptus.util.EucalyptusProperties;
import com.eucalyptus.util.SubDirectory;
-
+@Provides(resource=Resource.Database)
+@Depends(resources={Resource.SystemCredentials})
public class HsqldbBootstrapper extends Bootstrapper implements Runnable {
private static Logger LOG = Logger.getLogger( HsqldbBootstrapper.class );
private static HsqldbBootstrapper singleton;
View
8 clc/modules/cloud/src/main/resources/META-INF/eucalyptus-bootstrap.properties
@@ -1,8 +0,0 @@
-euca.cloud-model.xml=eucalyptus-cloud-model.xml
-euca.cloud-services.xml=eucalyptus-cloud-services.xml
-euca.interface.xml=eucalyptus-interface.xml
-euca.runtime.xml=eucalyptus-runtime.xml
-euca.services.xml=eucalyptus-services.xml
-euca.storage.xml=eucalyptus-storage.xml
-euca.userdata.xml=eucalyptus-userdata.xml
-euca.verification.xml=eucalyptus-verification.xml
View
45 clc/modules/cloud/src/main/resources/META-INF/eucalyptus-services.xml
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<mule xmlns="http://www.mulesource.org/schema/mule/core/2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:spring="http://www.springframework.org/schema/beans"
- xmlns:vm="http://www.mulesource.org/schema/mule/vm/2.0" xmlns:euca="http://www.eucalyptus.com/schema/cloud/1.6"
- xsi:schemaLocation="
- http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
- http://www.mulesource.org/schema/mule/core/2.0 http://www.mulesource.org/schema/mule/core/2.0/mule.xsd
- http://www.mulesource.org/schema/mule/vm/2.0 http://www.mulesource.org/schema/mule/vm/2.0/mule-vm.xsd
- http://www.eucalyptus.com/schema/cloud/1.6 http://www.eucalyptus.com/schema/cloud/1.6/euca.xsd">
-
- <!--interface services-->
- <endpoint name="ReplyQueueWS" address="vm://ReplyQueue" synchronous="false" />
-
- <!--user data services-->
- <endpoint name="ImageWS" address="vm://Image" synchronous="false" />
- <endpoint name="VolumeWS" address="vm://Volume" synchronous="false" />
- <endpoint name="SnapshotWS" address="vm://Snapshot" synchronous="false" />
- <euca:endpoint name="KeyPairWSTest" connector-ref="eucaws"
- address="http://127.0.0.1:8773/services/KeyPair" synchronous="true" />
-
- <endpoint name="KeyPairWS" address="vm://KeyPair" synchronous="false" />
- <endpoint name="GroupsWS" address="vm://Groups" synchronous="false" />
-
- <!--vm request verification pipeline-->
- <endpoint name="StartVerifyWS" address="vm://VmVerify" synchronous="false" />
- <endpoint name="ImageVerifyWS" address="vm://ImageVerify" synchronous="false" />
- <endpoint name="KeyPairVerifyWS" address="vm://KeyPairVerify" synchronous="false" />
- <endpoint name="GroupsVerifyWS" address="vm://GroupsVerify" synchronous="false" />
- <endpoint name="VmTypeVerifyWS" address="vm://VmTypeVerify" synchronous="false" />
- <endpoint name="FinishedVerifyWS" address="vm://VmVerified" synchronous="false" />
-
- <endpoint name="KeyPairResolveWS" address="vm://KeyPairResolve" synchronous="true" />
- <endpoint name="ImageResolveWS" address="vm://ImageResolve" synchronous="true" />
-
- <!--run-time system state services-->
- <endpoint name="ClusterEndpointWS" address="vm://ClusterEndpoint" synchronous="false" />
- <endpoint name="ClusterSinkWS" address="vm://ClusterSink" synchronous="false" />
- <endpoint name="VmMetadataWS" address="vm://VmMetadata" synchronous="true" />
- <endpoint name="VmControlWS" address="vm://VmControl" synchronous="false" />
- <endpoint name="AddressWS" address="vm://Address" synchronous="false" />
- <endpoint name="UpdateSystemWS" address="vm://UpdateSystemState" synchronous="false" />
- <endpoint name="SystemStateWS" address="vm://SystemState" synchronous="false" />
- <endpoint name="TransformReplyWS" address="vm://TransformReply" synchronous="false" />
-
-</mule>
View
7 clc/modules/cloud/src/main/resources/com.eucalyptus.CloudServiceProvider
@@ -1 +1,6 @@
-eucalyptus
+name=eucalyptus
+euca.model.interface=eucalyptus-interface.xml
+euca.model.runtime=eucalyptus-runtime.xml
+euca.model.storage=eucalyptus-storage.xml
+euca.model.userdata=eucalyptus-userdata.xml
+euca.model.verification=eucalyptus-verification.xml
View
0 ...urces/META-INF/eucalyptus-cloud-model.xml → ...main/resources/eucalyptus-cloud-model.xml
File renamed without changes.
View
0 ...es/META-INF/eucalyptus-cloud-services.xml → ...n/resources/eucalyptus-cloud-services.xml
File renamed without changes.
View
2 ...sources/META-INF/eucalyptus-interface.xml → ...c/main/resources/eucalyptus-interface.xml
@@ -35,7 +35,7 @@
<inbound>
<vm:inbound-endpoint address="vm://RequestQueue"/>
</inbound>
- <component class="edu.ucsb.eucalyptus.ic.RequestQueue"/>
+ <component class="com.eucalyptus.ws.util.RequestQueue"/>
<outbound>
<filtering-router>
<outbound-endpoint ref="StartVerifyWS"/>
View
0 ...in/resources/META-INF/eucalyptus-mule.xml → ...ud/src/main/resources/eucalyptus-mule.xml
File renamed without changes.
View
0 ...resources/META-INF/eucalyptus-runtime.xml → ...src/main/resources/eucalyptus-runtime.xml
File renamed without changes.
View
0 ...resources/META-INF/eucalyptus-storage.xml → ...src/main/resources/eucalyptus-storage.xml
File renamed without changes.
View
0 ...esources/META-INF/eucalyptus-userdata.xml → ...rc/main/resources/eucalyptus-userdata.xml
File renamed without changes.
View
0 ...rces/META-INF/eucalyptus-verification.xml → ...ain/resources/eucalyptus-verification.xml
File renamed without changes.
View
11 clc/modules/core/src/main/resources/log4j.xml
@@ -38,10 +38,9 @@
<appender name="console" class="org.apache.log4j.ConsoleAppender">
<param name="Target" value="System.out"/>
- <param name="Threshold" value="INFO"/>
- <layout class="org.apache.log4j.PatternLayout">
- <param name="ConversionPattern" value="%d{HH:mm:ss} %5p [%-.20c{1}:%.10t] %m%n"/>
- </layout>
+ <param name="Threshold" value="${euca.log.level}"/>
+<!-- <layout class="org.apache.log4j.PatternLayout"> -->
+ <layout class="com.eucalyptus.util.EucaLayout"/>
</appender>
<appender name="logfile" class="org.apache.log4j.RollingFileAppender">
<param name="File" value="${euca.log.dir}/cloud-debug.log"/>
@@ -66,6 +65,10 @@
<priority value="DEBUG"/>
<appender-ref ref="logfile"/>
</category>
+ <category name="org.apache.commons.beanutils.converters" additivity="false">
+ <priority value="ERROR"/>
+ <appender-ref ref="logfile"/>
+ </category>
<category name="org.apache.xml.security.signature.Reference" additivity="false">
<priority value="ERROR"/>
<appender-ref ref="logfile"/>
View
88 clc/modules/msgs/src/main/java/com/eucalyptus/bootstrap/BootstrapFactory.java
@@ -1,55 +1,77 @@
package com.eucalyptus.bootstrap;
+import java.io.File;
import java.io.IOException;
+import java.lang.annotation.Annotation;
import java.net.URL;
import java.util.Enumeration;
import java.util.List;
import org.apache.log4j.Logger;
+import org.mule.config.ConfigResource;
+import com.eucalyptus.util.BaseDirectory;
+import com.eucalyptus.util.EucalyptusProperties;
+import com.eucalyptus.util.LogUtils;
+import com.eucalyptus.util.ServiceJarFile;
import com.google.common.collect.Lists;
+import com.google.common.collect.Multimap;
+import com.google.common.collect.Multimaps;
public class BootstrapFactory {
- private static Logger LOG = Logger.getLogger( BootstrapFactory.class );
- public static void findAll() {
- for( ResourceProvider r : ResourceProvider.values( ) ) {
- r.getProviders( );
+ private static Logger LOG = Logger.getLogger( BootstrapFactory.class );
+ private static Multimap<Resource, ResourceProvider> resources = Multimaps.newArrayListMultimap( );
+ private static Multimap<Resource, Bootstrapper> bootstrappers = Multimaps.newArrayListMultimap( );
+
+ public static List<ResourceProvider> getResourceProviders( Resource r ){
+ return Lists.newArrayList( resources.get( r ) );
+ }
+ public static List<Bootstrapper> getBootstrappers( Resource r ){
+ return Lists.newArrayList( bootstrappers.get( r ) );
+ }
+ public static void initResourceProviders( ) {
+ for ( Resource r : Resource.values( ) ) {
+ for ( ResourceProvider p : r.getProviders( ) ) {
+ resources.put( r, p );
+ LOG.info( "Loaded " + LogUtils.dumpObject( p ) );
+ }
}
}
- public enum ResourceProvider {
- SystemCredentials(),
- Database(),
- ClusterCredentials(),
- UserCredentials(),
- CloudService(),
- ;
- private String resourceName;
- private static Logger LOG = Logger.getLogger( BootstrapFactory.ResourceProvider.class );
- private ResourceProvider() {
- this.resourceName = String.format( "com.eucalyptus.%sProvider", this.name( ) );
+
+ public static void initConfigurationResources( ) throws IOException {
+ for ( Resource r : Resource.values( ) ) {
+ for ( ResourceProvider p : resources.get( r ) ) {
+ for( ConfigResource cfg : p.initConfigurationResources( ) ) {
+ LOG.info( "Loaded " + LogUtils.dumpObject( cfg ) );
+ }
+ }
}
-
- @SuppressWarnings( "static-access" )
- public List<String> getProviders() {
- List<String> providers = Lists.newArrayList( );
- try {
- Enumeration<URL> p1 = ClassLoader.getSystemClassLoader( ).getResources( this.name( ) );
- URL u = null;
- while(p1.hasMoreElements( )) {
- u = p1.nextElement( );
- LOG.info( u );
+ }
+
+ public static void initBootstrappers( ) {
+ File libDir = new File( BaseDirectory.LIB.toString( ) );
+ for ( File f : libDir.listFiles( ) ) {
+ if ( f.getName( ).startsWith( EucalyptusProperties.NAME ) && f.getName( ).endsWith( ".jar" ) && !f.getName( ).matches( ".*-ext-.*" ) ) {
+ LOG.debug( "Found eucalyptus component jar: " + f.getName( ) );
+ ServiceJarFile jar;
+ try {
+ jar = new ServiceJarFile( f );
+ } catch ( IOException e ) {
+ LOG.error( e.getMessage( ) );
+ continue;
}
- Enumeration<URL> p2 = BootstrapFactory.class.getClassLoader( ).getSystemResources( this.name( ) );
- while(p1.hasMoreElements( )) {
- u = p1.nextElement( );
- LOG.info( u );
+ List<Bootstrapper> bsList = jar.getBootstrappers( );
+ for ( Bootstrapper bootstrap : bsList ) {
+ for ( Resource r : Resource.values( ) ) {
+ if ( r.providedBy( bootstrap.getClass( ) ) || Resource.Nothing.equals( r ) ) {
+ bootstrappers.put( r, bootstrap );
+ LOG.info( "--> Associated bootstrapper " + bootstrap.getClass( ).getSimpleName( ) + " with resource " + r.toString( ) );
+ break;
+ }
+ }
}
- } catch ( IOException e ) {
- e.printStackTrace();
}
- return providers;
}
-
}
}
View
6 clc/modules/msgs/src/main/java/com/eucalyptus/bootstrap/Bootstrapper.java
@@ -2,12 +2,11 @@
import org.apache.log4j.Logger;
+@Provides(resource=Resource.Nothing)
+@Depends(resources={Resource.Nothing})
public abstract class Bootstrapper {
private static Logger LOG = Logger.getLogger( Bootstrapper.class );
- public static String BOOTSTRAP_CONFIG_PROPERTY = "euca.bootstrap.config";
- public static String BASEDIR = "META-INF/";
- public static String PROPERTIES = BASEDIR + "eucalyptus-bootstrap.properties";
public static String SERVICES_PROPERTY = "euca.services";
public static String MODEL_PROPERTY = "euca.model";
public static String VERSION_PROPERTY = "euca.version";
@@ -16,7 +15,6 @@ public String getVersion() {
return System.getProperty( VERSION_PROPERTY );
}
-// public abstract boolean init() throws Exception;//this is uid 0
public abstract boolean load() throws Exception;
public abstract boolean start() throws Exception;
public abstract boolean check() throws Exception;
View
12 clc/modules/msgs/src/main/java/com/eucalyptus/bootstrap/Depends.java
@@ -0,0 +1,12 @@
+package com.eucalyptus.bootstrap;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Target({ ElementType.TYPE, ElementType.FIELD })
+@Retention(RetentionPolicy.RUNTIME)
+public @interface Depends {
+ Resource[] resources() default {Resource.Nothing};
+}
View
12 clc/modules/msgs/src/main/java/com/eucalyptus/bootstrap/Provides.java
@@ -0,0 +1,12 @@
+package com.eucalyptus.bootstrap;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Target({ ElementType.TYPE, ElementType.FIELD })
+@Retention(RetentionPolicy.RUNTIME)
+public @interface Provides {
+ Resource resource() default Resource.Nothing;
+}
View
66 clc/modules/msgs/src/main/java/com/eucalyptus/bootstrap/Resource.java
@@ -0,0 +1,66 @@
+package com.eucalyptus.bootstrap;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.lang.annotation.Annotation;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.Properties;
+
+import org.apache.log4j.Logger;
+
+import com.google.common.collect.Lists;
+
+public enum Resource {
+ Bootstrap( ),
+ PrivilegedContext( ),
+ SystemCredentials( ),
+ Database( ),
+ ClusterCredentials( ),
+ UserCredentials( ),
+ CloudService( ),
+ SpringService( ),
+ Nothing( ), ;
+ private String resourceName;
+ private boolean initialized = false; //TODO: state needed for @Depends
+ private boolean started = false;
+ private static Logger LOG = Logger.getLogger( Resource.class );
+
+ private Resource( ) {
+ this.resourceName = String.format( "com.eucalyptus.%sProvider", this.name( ) );
+ }
+
+ public List<ResourceProvider> getProviders( ) {
+ List<ResourceProvider> providers = Lists.newArrayList( );
+ Enumeration<URL> p1;
+ try {
+ p1 = Thread.currentThread( ).getContextClassLoader( ).getResources( this.resourceName );
+ try {
+ URL u = null;
+ while ( p1.hasMoreElements( ) ) {
+ u = p1.nextElement( );
+ LOG.debug( "Found resource provider: " + u );
+ Properties props = new Properties( );
+ props.load( u.openStream( ) );
+ providers.add( new ResourceProvider( this, props, u ) );
+ }
+ } catch ( IOException e ) {
+ LOG.error( e, e );
+ }
+ } catch ( IOException e1 ) {
+ LOG.error( e1, e1 );
+ }
+ return providers;
+ }
+
+ public boolean providedBy( Class clazz ) {
+ for ( Annotation a : clazz.getAnnotations( ) ) {
+ if ( a instanceof Provides && this.equals(((Provides)a).resource( ) )) {
+ return true;
+ }
+ }
+ return false;
+ }
+}
View
60 clc/modules/msgs/src/main/java/com/eucalyptus/bootstrap/ResourceProvider.java
@@ -0,0 +1,60 @@
+package com.eucalyptus.bootstrap;
+
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.net.URL;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+import org.apache.log4j.Logger;
+import org.mule.config.ConfigResource;
+
+import net.sf.json.JSONObject;
+
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+
+public class ResourceProvider {
+ private static Logger LOG = Logger.getLogger( ResourceProvider.class );
+ private final Resource resource;
+ private final URL origin;
+ private final String name;
+ private final Map<String, String> properties;
+ private final List<ConfigResource> configs;
+
+ @SuppressWarnings( "unchecked" )
+ public ResourceProvider( Resource resource, Properties props, URL origin ) {
+ this.resource = resource;
+ this.properties = Maps.newHashMap( ( Hashtable ) props );
+ this.name = this.properties.remove( "name" );
+ this.origin = origin;
+ this.configs = Lists.newArrayList( );
+ }
+
+ public List<ConfigResource> initConfigurationResources() throws IOException {
+ for(String rscName : this.properties.keySet( )) {
+ try {
+ this.configs.add( new ConfigResource( this.properties.get( rscName ) ) );
+ } catch ( IOException e ) {
+ LOG.error( String.format("Processing %s caused an error %s: %s", this.origin, e.getClass().getSimpleName( ), e.getMessage( )), e );
+ throw e;
+ }
+ }
+ return this.configs;
+ }
+
+ public Resource getResource( ) {
+ return resource;
+ }
+
+ public String getName( ) {
+ return name;
+ }
+
+ public URL getOrigin( ) {
+ return origin;
+ }
+
+}
View
81 clc/modules/msgs/src/main/java/com/eucalyptus/bootstrap/SystemBootstrapper.java
@@ -19,13 +19,13 @@
import com.eucalyptus.util.BaseDirectory;
import com.eucalyptus.util.EucalyptusProperties;
+import com.eucalyptus.util.LogUtils;
import com.eucalyptus.util.ServiceJarFile;
import com.google.common.collect.Lists;
public class SystemBootstrapper extends Bootstrapper {
private static Logger LOG = Logger.getLogger( SystemBootstrapper.class );
static {
- LOG.info( "Loaded Bootstrapper." );
System.setProperty( "euca.db.host", "127.0.0.1" );
System.setProperty( "euca.db.port", "9001" );
System.setProperty( "euca.db.password", "" );
@@ -45,7 +45,6 @@ public static Bootstrapper getInstance( ) {
}
private MuleContext context;
- private List<ConfigResource> configs = Lists.newArrayList( );
private List<Bootstrapper> bootstrappers = Lists.newArrayList( );
private SystemBootstrapper( ) {
@@ -65,76 +64,52 @@ public boolean stop( ) throws Exception {
@Override
public boolean start( ) throws Exception {
LOG.info( "Starting Eucalyptus." );
- BootstrapFactory.findAll( );
try {
for ( Bootstrapper b : this.bootstrappers ) {
LOG.info( "-> Invoking bootstrapper " + b.getClass( ).getSimpleName( ) + ".start()Z" );
b.start( );
}
+ LOG.info( LogUtils.header( "Starting Eucalyptus." ) );
context.start( );
return true;
} catch ( Exception e ) {
LOG.error( e, e );
return false;
}
}
-
- @SuppressWarnings( "deprecation" )
+
@Override
public boolean load( ) throws Exception {
- ClassLoader currentLoader = Thread.currentThread().getContextClassLoader();
- try {
- Enumeration resources = currentLoader.getResources("com.eucalyptus.CloudServiceProvider");
- while (resources.hasMoreElements()) {
- System.out.println("========================\n\nElements found:" + resources.nextElement() + "\n\n========================");
+ LOG.info( LogUtils.header( "Initializing resource providers." ) );
+ BootstrapFactory.initResourceProviders( );
+ LOG.info( LogUtils.header( "Initializing configuration resources." ) );
+ BootstrapFactory.initConfigurationResources( );
+ LOG.info( LogUtils.header( "Initializing bootstrappers." ) );
+ BootstrapFactory.initBootstrappers( );
+ for( Resource r : Resource.values( ) ) {
+ LOG.info( LogUtils.header( "Bootstrapping " + r ) );
+ for( Bootstrapper b : BootstrapFactory.getBootstrappers( r ) ) {
+ LOG.info( b.getClass( ) );
}
- } catch (IOException e) {
- e.printStackTrace();
}
+
//TODO: discovery persistence contexts
//TODO: determine the role of this component
- String bootstrapConfig = System.getProperty( Bootstrapper.BOOTSTRAP_CONFIG_PROPERTY );
- Enumeration<URL> test = SystemBootstrapper.class.getClassLoader( ).getResources( "com.eucalyptus.CloudServiceProvider" );
- if( bootstrapConfig == null || test == null ) {
- LOG.fatal( "Bootstrap configuration property is undefined: " + Bootstrapper.BOOTSTRAP_CONFIG_PROPERTY );
- return false;
- }
- try {
- this.configs.add( new ConfigResource( bootstrapConfig ) );
- } catch ( Exception e ) {
- LOG.fatal( "Couldn't load bootstrap configuration file: " + bootstrapConfig, e );
- return false;
- }
- LOG.info( "Eucalyptus component discovery [" + BaseDirectory.LIB.toString( ) +"]" );
- File libDir = new File( BaseDirectory.LIB.toString( ) );
- for ( File f : libDir.listFiles( ) ) {
- if ( f.getName( ).startsWith( EucalyptusProperties.NAME ) && f.getName( ).endsWith( ".jar" ) ) {
- try {
- LOG.info( "Found eucalyptus component jar: " + f.getName( ) );
- ServiceJarFile jar = new ServiceJarFile( f );
- this.bootstrappers.addAll( jar.getBootstrappers( this.getClass( ) ) );
- this.configs.addAll( jar.getConfigResources( ) );
- } catch ( IOException e ) {
- LOG.fatal( e,e );
- SystemBootstrapper.shutdown( false );
- return false;
- }
- }
- }
- try {
- LOG.info( "-> Configuring..." );
- context = new DefaultMuleContextFactory( ).createMuleContext( new SpringXmlConfigurationBuilder( configs.toArray( new ConfigResource[] {} ) ) );
- for ( Bootstrapper b : this.bootstrappers ) {
- LOG.info( "-> Found bootsrapper " + b.getClass( ).getSimpleName( ) + ".load()Z" );
- }
- for ( Bootstrapper b : this.bootstrappers ) {
- LOG.info( "-> Invoking bootstrapper " + b.getClass( ).getSimpleName( ) + ".load()Z" );
- b.load( );
- }
- } catch ( Exception e ) {
- LOG.info( e, e );
- }
+ LOG.info( "-> Configuring..." );
+
+// context = new DefaultMuleContextFactory( ).createMuleContext( new SpringXmlConfigurationBuilder( configs.toArray( new ConfigResource[] {} ) ) );
+// for ( Bootstrapper b : this.bootstrappers ) {
+// LOG.info( "-> Found bootstrapper " + b.getClass( ).getSimpleName( ) + ".load()Z" );
+// }
+// for ( Bootstrapper b : this.bootstrappers ) {
+// LOG.info( "-> Invoking bootstrapper " + b.getClass( ).getSimpleName( ) + ".load()Z" );
+// try {
+// b.load( );
+// } catch ( Exception e ) {
+// LOG.info( e, e );
+// }
+// }
return true;
}
View
53 clc/modules/msgs/src/main/java/com/eucalyptus/util/EucaLayout.java
@@ -0,0 +1,53 @@
+package com.eucalyptus.util;
+
+import org.apache.log4j.PatternLayout;
+import org.apache.log4j.spi.LoggingEvent;
+
+public class EucaLayout extends PatternLayout {
+ public static int LINE_BYTES = 100;
+ static {
+ try {
+ LINE_BYTES = Integer.parseInt( System.getenv( "COLUMNS" ) );
+ } catch ( NumberFormatException e ) {}
+ }
+ public static String PATTERN = "%d{HH:mm:ss} %5p %-20.20c{1} | %-100.100m%n";
+ private String CONTINUATION = "%m%n";
+ private PatternLayout continuation = null;
+
+
+ public EucaLayout( ) {
+ super( PATTERN );
+
+ }
+
+ public EucaLayout( String pattern ) {
+ super( PATTERN );
+
+ }
+
+ @Override
+ public String format( LoggingEvent event ) {
+ String[] messages = event.getRenderedMessage( ).split( "\n" );
+ StringBuffer sb = new StringBuffer( );
+ boolean con = false;
+ for( int i = 0; i < messages.length; i++ ) {
+// String message= messages[i];
+ String substring= messages[i];
+// while ( message.length( ) > 0 ) {
+// int rb = LINE_BYTES>message.length( )?message.length( ):LINE_BYTES;
+// String substring = message.substring( 0, rb );
+// message = message.substring( rb );
+ LoggingEvent n = new LoggingEvent( event.getFQNOfLoggerClass( ), event.getLogger( ),
+ event.getTimeStamp( ), event.getLevel( ),
+ substring, event.getThreadName( ),
+ event.getThrowableInformation( ), null, null, null );
+ sb.append( (!con)?super.format( n ):continuation.format( n ) );
+ if(continuation==null) {
+ continuation = new PatternLayout(sb.toString( ).split( "\\|" )[0].replaceAll( ".", " " )+"| "+CONTINUATION);
+ }
+ con = true;
+// }
+ }
+ return sb.toString( );
+ }
+}
View
17 clc/modules/msgs/src/main/java/com/eucalyptus/util/LogUtils.java
@@ -0,0 +1,17 @@
+package com.eucalyptus.util;
+
+import org.apache.log4j.PatternLayout;
+import org.apache.log4j.spi.LoggingEvent;
+
+import net.sf.json.JSONObject;
+
+public class LogUtils {
+ private static String LONG_BAR = "=============================================================================================================================================================================================================";
+ public static String header( String message ) {
+ return String.format( "\n%80.80s\n%s\n%1$80.80s", LONG_BAR, message );
+ }
+
+ public static String dumpObject( Object o ) {
+ return JSONObject.fromObject( o ).toString( );
+ }
+}
View
43 clc/modules/msgs/src/main/java/com/eucalyptus/util/ServiceJarFile.java
@@ -20,6 +20,7 @@
import org.mule.config.ConfigResource;
import com.eucalyptus.bootstrap.Bootstrapper;
+import com.eucalyptus.bootstrap.SystemBootstrapper;
import com.google.common.collect.Lists;
public class ServiceJarFile extends JarFile {
@@ -35,58 +36,40 @@ public ServiceJarFile( File f ) throws IOException {
this.bootstrappers = Lists.newArrayList( );
Enumeration<JarEntry> jarList = this.entries( );
this.classLoader = URLClassLoader.newInstance( new URL[] { f.getAbsoluteFile( ).toURL( ) } );
+ LOG.debug( "-> Trying to load component info from " + f.getAbsolutePath( ) );
while ( jarList.hasMoreElements( ) ) {
JarEntry j = jarList.nextElement( );
- if ( Bootstrapper.PROPERTIES.equals( j.getName( ) ) ) {
- try {
- InputStream in = this.getInputStream( j );
- props.load( in );
- } catch ( IOException e ) {
- }
- } else if ( j.getName( ).endsWith( ".class" ) ) {
+ LOG.debug( "--> Handling entry: " + j.getName( ) );
+ if ( j.getName( ).endsWith( ".class" ) ) {
try {
Class c = ServiceJarFile.this.getBootstrapper( j );
+ LOG.debug( "---> Loading bootstrapper from entry: " + j.getName( ) );
this.bootstrappers.add( c );
} catch ( Exception e ) {
- LOG.trace(e);
+ LOG.debug( e, e );
}
}
}
- this.components = new HashMap<String, String>( ( Hashtable ) props );
}
@SuppressWarnings( "unchecked" )
- public List<Bootstrapper> getBootstrappers( Class excludeClass ) {
+ public List<Bootstrapper> getBootstrappers( ) {
List<Bootstrapper> ret = Lists.newArrayList( );
for ( Class c : this.bootstrappers ) {
- if( c.equals( excludeClass ) ) continue;
+ if ( c.equals( SystemBootstrapper.class ) ) continue;
try {
LOG.debug( "-> Calling <init>()V on bootstrapper: " + c.getCanonicalName( ) );
try {
ret.add( ( Bootstrapper ) c.newInstance( ) );
} catch ( Exception e ) {
LOG.debug( "-> Calling getInstance()L; on bootstrapper: " + c.getCanonicalName( ) );
- Method m = c.getDeclaredMethod( "getInstance", new Class[]{} );
- ret.add( ( Bootstrapper ) m.invoke( null, new Object[]{} ) );
+ Method m = c.getDeclaredMethod( "getInstance", new Class[] {} );
+ ret.add( ( Bootstrapper ) m.invoke( null, new Object[] {} ) );
}
} catch ( Exception e ) {
LOG.warn( "Error in <init>()V and getInstance()L; in bootstrapper: " + c.getCanonicalName( ) );
LOG.warn( e.getMessage( ) );
- LOG.debug( e,e );
- }
- }
- return ret;
- }
-
- public List<ConfigResource> getConfigResources( ) {
- List<ConfigResource> ret = Lists.newArrayList( );
- for ( String configKey : this.components.keySet( ) ) {
- try {
- LOG.debug( "-> Loading config resource: " + this.components.get( configKey ) );
- ConfigResource rsrc = new ConfigResource( configKey, this.getInputStream( this.getEntry( Bootstrapper.BASEDIR + this.components.get( configKey ) ) ) );
- ret.add( rsrc );
- } catch ( IOException e ) {
- LOG.debug( "Error loading config resource indicated by properties file: " + Bootstrapper.BASEDIR + this.components.get( configKey ) );
+ LOG.debug( e, e );
}
}
return ret;
@@ -100,9 +83,7 @@ private Class getBootstrapper( JarEntry j ) throws Exception {
if ( !Bootstrapper.class.isAssignableFrom( candidate ) ) throw new InstantiationException( candidate + " does not conform to " + Bootstrapper.class );
if ( !Modifier.isPublic( candidate.getDeclaredConstructor( new Class[] {} ).getModifiers( ) ) ) {
Method factory = candidate.getDeclaredMethod( "getInstance", new Class[] {} );
- if ( !Modifier.isStatic( factory.getModifiers( ) ) || !Modifier.isPublic( factory.getModifiers( ) ) ) {
- throw new InstantiationException( candidate.getCanonicalName( ) + " does not declare public <init>()V or public static getInstance()L;" );
- }
+ if ( !Modifier.isStatic( factory.getModifiers( ) ) || !Modifier.isPublic( factory.getModifiers( ) ) ) { throw new InstantiationException( candidate.getCanonicalName( ) + " does not declare public <init>()V or public static getInstance()L;" ); }
}
return candidate;
}
View
89 clc/modules/msgs/src/main/resources/eucalyptus-bootstrap.xml
@@ -1,20 +1,105 @@
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesource.org/schema/mule/core/2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:spring="http://www.springframework.org/schema/beans"
- xmlns:euca="http://www.eucalyptus.com/schema/cloud/1.6"
+ xmlns:euca="http://www.eucalyptus.com/schema/cloud/1.6" xmlns:vm="http://www.mulesource.org/schema/mule/vm/2.0"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.mulesource.org/schema/mule/core/2.0 http://www.mulesource.org/schema/mule/core/2.0/mule.xsd
+ http://www.mulesource.org/schema/mule/vm/2.0 http://www.mulesource.org/schema/mule/vm/2.0/mule-vm.xsd
http://www.eucalyptus.com/schema/cloud/1.6 http://www.eucalyptus.com/schema/cloud/1.6/euca.xsd">
<euca:connector name="eucaws" />
- <model name="eucalyptus-bootstrap">
+ <!-- TODO: remove all these forward references somehow -->
+ <!--interface services-->
+ <endpoint name="ReplyQueueWS" address="vm://ReplyQueue" synchronous="false" />
+ <!--user data services-->
+ <endpoint name="ImageWS" address="vm://Image" synchronous="false" />
+ <endpoint name="VolumeWS" address="vm://Volume" synchronous="false" />
+ <endpoint name="SnapshotWS" address="vm://Snapshot" synchronous="false" />
+ <euca:endpoint name="KeyPairWSTest" connector-ref="eucaws" address="http://127.0.0.1:8773/services/KeyPair" synchronous="true" />
+ <endpoint name="KeyPairWS" address="vm://KeyPair" synchronous="false" />
+ <endpoint name="GroupsWS" address="vm://Groups" synchronous="false" />
+ <!--vm request verification pipeline-->
+ <endpoint name="StartVerifyWS" address="vm://VmVerify" synchronous="false" />
+ <endpoint name="ImageVerifyWS" address="vm://ImageVerify" synchronous="false" />
+ <endpoint name="KeyPairVerifyWS" address="vm://KeyPairVerify" synchronous="false" />
+ <endpoint name="GroupsVerifyWS" address="vm://GroupsVerify" synchronous="false" />
+ <endpoint name="VmTypeVerifyWS" address="vm://VmTypeVerify" synchronous="false" />
+ <endpoint name="FinishedVerifyWS" address="vm://VmVerified" synchronous="false" />
+ <endpoint name="KeyPairResolveWS" address="vm://KeyPairResolve" synchronous="true" />
+ <endpoint name="ImageResolveWS" address="vm://ImageResolve" synchronous="true" />
+ <!--run-time system state services-->
+ <endpoint name="ClusterEndpointWS" address="vm://ClusterEndpoint" synchronous="false" />
+ <endpoint name="ClusterSinkWS" address="vm://ClusterSink" synchronous="false" />
+ <endpoint name="VmMetadataWS" address="vm://VmMetadata" synchronous="true" />
+ <endpoint name="VmControlWS" address="vm://VmControl" synchronous="false" />
+ <endpoint name="AddressWS" address="vm://Address" synchronous="false" />
+ <endpoint name="UpdateSystemWS" address="vm://UpdateSystemState" synchronous="false" />
+ <endpoint name="SystemStateWS" address="vm://SystemState" synchronous="false" />
+ <endpoint name="TransformReplyWS" address="vm://TransformReply" synchronous="false" />
+
+ <model name="eucalyptus-webservices">
+ <default-service-exception-strategy>
+ <outbound-endpoint ref="ReplyQueueWS" />
+ </default-service-exception-strategy>
<service name="ReplyQueue">
<inbound>
<inbound-endpoint ref="ReplyQueueWS" />
</inbound>
<component class="com.eucalyptus.ws.util.ReplyQueue" />
</service>
+ <service name="RequestQueue">
+ <inbound>
+ <vm:inbound-endpoint address="vm://RequestQueue" />
+ </inbound>
+ <component class="com.eucalyptus.ws.util.RequestQueue" />
+ <outbound>
+ <filtering-router>
+ <outbound-endpoint ref="StartVerifyWS" />
+ <payload-type-filter expectedType="edu.ucsb.eucalyptus.msgs.RunInstancesType" />
+ </filtering-router>
+ <filtering-router>
+ <outbound-endpoint ref="VmControlWS" />
+ <payload-type-filter expectedType="edu.ucsb.eucalyptus.msgs.VmControlMessage" />
+ </filtering-router>
+ <filtering-router>
+ <outbound-endpoint ref="ClusterEndpointWS" />
+ <payload-type-filter expectedType="edu.ucsb.eucalyptus.msgs.ClusterMessage" />
+ </filtering-router>
+ <filtering-router>
+ <outbound-endpoint ref="KeyPairWSTest" />
+ <payload-type-filter expectedType="edu.ucsb.eucalyptus.msgs.VmKeyPairMessage" />
+ </filtering-router>
+ <filtering-router>
+ <outbound-endpoint ref="ImageWS" />
+ <payload-type-filter expectedType="edu.ucsb.eucalyptus.msgs.VmImageMessage" />
+ </filtering-router>
+ <filtering-router>
+ <outbound-endpoint ref="VolumeWS" />
+ <payload-type-filter expectedType="edu.ucsb.eucalyptus.msgs.BlockVolumeMessage" />
+ </filtering-router>
+ <filtering-router>
+ <outbound-endpoint ref="SnapshotWS" />
+ <payload-type-filter expectedType="edu.ucsb.eucalyptus.msgs.BlockSnapshotMessage" />
+ </filtering-router>
+ <filtering-router>
+ <outbound-endpoint ref="AddressWS" />
+ <payload-type-filter expectedType="edu.ucsb.eucalyptus.msgs.VmAddressMessage" />
+ </filtering-router>
+ <filtering-router>
+ <outbound-endpoint ref="GroupsWS" />
+ <payload-type-filter expectedType="edu.ucsb.eucalyptus.msgs.VmSecurityMessage" />
+ </filtering-router>
+ <filtering-router>
+ <outbound-endpoint address="vm://Bukkit" synchronous="false" />
+ <payload-type-filter expectedType="edu.ucsb.eucalyptus.msgs.WalrusRequestType" />
+ </filtering-router>
+ <filtering-router>
+ <outbound-endpoint address="vm://Storage" synchronous="false" />
+ <payload-type-filter expectedType="edu.ucsb.eucalyptus.msgs.StorageRequestType" />
+ </filtering-router>
+ </outbound>
+ </service>
</model>
</mule>
View
2 clc/modules/storage-controller/src/main/resources/com.eucalyptus.CloudServiceProvider
@@ -1 +1 @@
-sc
+name=sc
View
2 clc/modules/storage-manager/src/main/resources/com.eucalyptus.CloudServiceProvider
@@ -1 +1 @@
-walrus
+name=walrus
View
2 .../edu/ucsb/eucalyptus/ic/RequestQueue.java → .../com/eucalyptus/ws/util/RequestQueue.java
@@ -32,7 +32,7 @@
* Author: Chris Grzegorczyk grze@cs.ucsb.edu
*/
-package edu.ucsb.eucalyptus.ic;
+package com.eucalyptus.ws.util;
import edu.ucsb.eucalyptus.msgs.EucalyptusMessage;

0 comments on commit 68bf3af

Please sign in to comment.