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 : 20.06.2003
  * Created by : s3595
  */
 package at.spardat.xma.boot.comp;
 
 
AppContainer is a data-object that holds information about a running application and it�s components.

Author(s):
s3595 Chr. Schaefer (CGS)
Version:
$Id: AppContainer.java 2084 2007-11-27 14:53:31Z s3460 $
 
 public class AppContainer implements IBootRuntime {

    
application description
 
     private XMAApp app_;

    
custom class-loader
 
     private CCLoader ccl_;

    
the xma session for this application
 
     private IRtXMASessionClient session_;

    
running components one or more components of an application can be instantiated.
 
     private HashMap runcmp_;

    
the application manager
 
     private AppManager appManager_;

    
the application hash
 
     private byte[] digest_;

    
the runtime version number send from the server
 
     private VersionNumber serverVers_;
 
     public AppContainer () {
              = null;
              = null;
          = null;
           = new HashMap();
           = null;
     }

    
set application manager
 
     public void setAppManagerAppManager in) {
          = in;
     }

    
get application manager
 
     public AppManager getAppManager() {
         return ;
     }

    

Returns:
XMAApp xma application description
 
     public XMAApp getApp() {
         return ;
     }

    
get the the xma session for this application
 
     public IRtXMASessionClient getSession( ) {
         return ;
     }

    

Returns:
CCLoader
 
     public CCLoader getCcl() {
         return ;
     }

    

Parameters:
app
    public void setApp(XMAApp app) {
         = app;
    }

    

Parameters:
loader
    public void setCcl(CCLoader loader) {
         = loader;
    }

    

Returns:
CCLoader
    public CCLoader getCcl_() {
        return ;
    }

    

Parameters:
app
    public void setApp_(XMAApp app) {
         = app;
    }

    

Parameters:
loader
    public void setCcl_(CCLoader loader) {
         = loader;
    }

    

Parameters:
client
    public void setSession(IRtXMASessionClient client) {
         = client;
    }

    

Returns:
IRtXMASessionClient
    public IRtXMASessionClient getSession_() {
        return ;
    }

    

Parameters:
client
    public void setSession_(IRtXMASessionClient client) {
         = client;
    }

    

Returns:
HashMap
    public HashMap getRuncmp_() {
        return ;
    }

    

Parameters:
map
    public void setRuncmp_(HashMap map) {
         = map;
    }


    

Returns:
Returns the serverVers_.
    public VersionNumber getServerVers() {
        return ;
    }
    

Parameters:
serverVers The serverVers to set.
    public void setServerVers(VersionNumber serverVers) {
        this. = serverVers;
    }
    public boolean isRunningCmpXMAComponent cmp ) {
        XMAComponent res = getRunningCmp(cmp);
        if (res != null)
          return true;
        return false;
    }
    public XMAComponent getRunningCmpXMAComponent cmp ) {
        return getRunningCmp(cmp.getName_());
    }
    public XMAComponent getRunningCmpString strCmpName ) {
        return (XMAComponent)getRuncmp_().getstrCmpName );
    }
    public void addRunningCmpXMAComponent cmp ) {
        getRuncmp_().putcmp.getName_(), cmp );
    }
    public XMAComponent remRunningCmpString name ) {
      XMAComponent cmp = (XMAComponent)getRuncmp_().remove(name);
      return cmp;
    }
    public int runningCmp() {
        return getRuncmp_().size();
    }

    

Returns:
application descriptor digest value
    public byte[] getDigest() {
        return ;
    }

    

Parameters:
bs application descriptor digest value
    public void setDigest(byte[] bs) {
         = bs;
    }
    public String getDigestAsString() {
        StringBuffer checksumSb = new StringBuffer();
        for (int i = 0; i < .i++) {
            String hexStr = Integer.toHexString(0x00ff & [i]);
            if (hexStr.length() < 2) {
                checksumSb.append("0");
            }
            checksumSb.append(hexStr);
        }
        String checksum = checksumSb.toString();
        return checksum;
    }
    /* (non-Javadoc)
     * @see at.spardat.xma.boot.component.IBootRuntime#getComponent(java.lang.String)
     */
    public IComponent getComponent(String componentthrows Exception {
        return getAppManager().getComponent(component);
    }
    /* (non-Javadoc)
     * @see at.spardat.xma.boot.component.IBootRuntime#endComponent(at.spardat.xma.boot.component.IComponent)
     */
    public void endComponent(IComponent rtc) {
        getAppManager().endComponent(rtc);
    }
    /* (non-Javadoc)
     * @see at.spardat.xma.boot.component.IBootRuntime#getPluginImplClient(java.lang.String)
     */
    public String getPluginImplClient(String interfaceName) {
        XMAPluginImpl impl = .getPluginImplinterfaceName );
        ifimpl == null ) {
            throw new RuntimeException ("no implementation for plug-in-interface " + interfaceName);
        }
        String strImpl = impl.getImplClient_();
        ifstrImpl == null )
            throw new RuntimeException ("no implementation for plug-in-interface " + interfaceName);
        return strImpl;
    }
New to GrepCode? Check out our FAQ X