WSO2

Points to Keep in Mind

  1. API Management
  2. Strip off unnecessary components (for lightweight)
  3. Develop Stratos components
  4. Cloudify (configuration, communication, load balancing)
  5. Security - WS Security, REST Security
  6. Performance - Latency, Throughput, Downtime
  7. Monitoring
  8. Database - MongoDB?
  9. Bloat about XML configuration
  10. Identity Management
  11. Upgrading
  12. Backward compatible
  13. Migration script

Installation

Database

mysql> insert into mysql.user (host, user, password) values(‘localhost’, ‘userstore’, password(‘userstore’));
mysql> flush privileges;

Need to do the same for user ‘registry’

Carbon

Start script: wso2server.sh

Main class: org.wso2.carbon.bootstrap.Bootstrap

public static void main(String[] args) {
    //Setting Carbon Home
    if (System.getProperty(LauncherConstants.CARBON_HOME) == null) {
        System.setProperty(LauncherConstants.CARBON_HOME, ".");
    }
    System.setProperty(LauncherConstants.AXIS2_HOME, System.getProperty(LauncherConstants.CARBON_HOME));

    //To keep track of the time taken to start the Carbon server.
    System.setProperty("wso2carbon.start.time", System.currentTimeMillis() + "");

    writePID(System.getProperty(LauncherConstants.CARBON_HOME));

    processCmdLineArgs(args);
    invokeExtensions();
    launchCarbon();
}

CarbonLauncher

setup framework class loader ?? java.security.AccessController.doPrivileged (why)

launch() {
  build initial property map - read from repository/conf/etc/launch.ini
  for osgi properties, mainly defined the JDK packages exported through the system bundle
  org.osgi.framework.system.packages

  then invoke org.eclipse.core.runtime.adaptor.EclipseStarter.startup()
}

how to handle class loader in a framework

ClassLoader original = Thread.currentThread().getContextClassLoader();
try {
    frameworkClassLoader = java.security.AccessController.doPrivileged(
                new java.security.PrivilegedAction<URLClassLoader>() {
                    public URLClassLoader run() {
                        URLClassLoader cl = null;
                        try {
                            cl = new ChildFirstURLClassLoader(
                                    new URL[]{new URL(initialPropsMap.get(OSGI_FRAMEWORK))}, null);
                        } catch (MalformedURLException e) {
                            log.error(e.getMessage(), e);
                        }
                        return cl;
                    }
                }
        );
} finally {
  Thread.currentThread().setContextClassLoader(original);
}

How Tomcat is started

org.wso2.carbon.tomcat.internal.TomcatBundleActivator

标签

归档