Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2003, 2007 s IT Solutions AT Spardat GmbH . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html Contributors: s IT Solutions AT Spardat GmbH - initial API and implementation /
 
 
 /*
  * Created on : 09.07.2003
  * Created by : s3595
  */
 package at.spardat.xma.boot.server;
 
 
 
ServerAppLoader

Author(s):
s3595 Chr. Schaefer (CGS)
Version:
$Id: ServerAppLoader.java 11290 2013-12-12 16:00:27Z dschwarz $
 
 public class ServerAppLoader extends AppLoaderBase {

    
the application descriptor of this webapplication
 
     private static XMAApp xmaapp;

    
the hash code of the application descritptor
 
     private static byte[] digest_;

    

Parameters:
pnew configuration properties
 
     public ServerAppLoader(Properties pnew) {
         super(pnew);
     }


    
load and parse application descriptors.

Parameters:
context servlet context
Throws:
java.lang.Exception
 
     public void loadApplication ( ServletContext context ) throws Exception {
         InputStream is=null;
         InputStream ispi=null;
         try {
             is   = context.getResourceAsStream"/" + .); //$NON-NLS-1$
             ispi = context.getResourceAsStream"/" + .); //$NON-NLS-1$
 
             XMAAppParser parser = new XMAAppParsersuper.truenull );
             XMAApp       xmaapp = parser.parseis );
 
             ifispi != null) {
                 XMAApp plugins = parser.parseispi );
                 super.mergeInto(xmaappplugins);
             }
 
             AppLoader.checkResourceIntegrityxmaapp );
             ArrayList missing = AppLoader.checkPluginSpecImplxmaapp );
 
             ifmissing.size() > 0 ){
                 throw new ServletException("XMA Application Descriptor has missing plugin-resources: " + missing ); //$NON-NLS-1$
             }
             createApplicationHash(context);
             ServerAppLoader.setXmaappxmaapp );
         } finally {
             Util.close(is,.);
             Util.close(ispi,.);
         }
     }

    
computes and sets the application hash code

Parameters:
context Servlet context
Throws:
java.lang.Exception NoSuchAlgorithm and IOException
 
     private void createApplicationHashServletContext context ) throws Exception {
         InputStream isApp=null;
         InputStream isPi=null;
         try {
            isApp = context.getResourceAsStream"/" + .); //$NON-NLS-1$
            isPi  = context.getResourceAsStream"/" + .); //$NON-NLS-1$
            setDigestcreateApplicationHash(isAppisPi ) );
        } finally {
            Util.close(isApp,.);
            Util.close(isPi,.);
        }
    }

    

Returns:
XMAApp xma application descriptor
    public static XMAApp getXmaapp() {
        return ;
    }

    

Parameters:
app xma application descriptor
    private static void setXmaapp(XMAApp app) {
         = app;
    }

    

Returns:
application digest (hash code)
    public static byte[] getDigest() {
        return ;
    }

    

Parameters:
bs set application digest
    private static void setDigest(byte[] bs) {
         = bs;
    }
New to GrepCode? Check out our FAQ X