at.spardat.xma.boot.component.IComponentHelper Maven / Gradle / Ivy
/*******************************************************************************
* 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
*******************************************************************************/
/*
* @(#) $Id: IComponentHelper.java 2084 2007-11-27 14:53:31Z s3460 $
*
*/
package at.spardat.xma.boot.component;
import java.util.Properties;
/**
* Interface to ComponentHelper which is deployed in the same classloader as SWT and IComponent.
* It encapsulates the code of the bootruntime which is dependend on SWT.
* @author s2877
*/
public interface IComponentHelper {
/**
* Just casts the given object to IComponent.
* @return the unchanged component
* @throws ClassCastException if the given object is not an IComponent
*/
IComponent castToIComponent(Object component);
/**
* Calls {@link IComponent#getRTSession()} on the given component.
* @return the client side session the given component belongs to.
* @throws ClassCastException if the given object is not an IComponent
*/
IRtXMASessionClient getRTSession(Object component);
/**
* Launches the given component. The input properties are passed to the component,
* then the component is invoked. Finally the component is disposed.
* @return the output properties of the given component
* @throws ClassCastException if the given object is not an IComponent
*/
Properties launch(Object component, Properties input);
/**
* Creates a Display in SWT if none allready exists.
* @return the preexisting or created Display.
*/
Object initSWTDisplay();
/**
* Disposes the display created by {@link #initSWTDisplay()} of this IComponentHelper.
* If no display was created by {@link #initSWTDisplay()}, it does nothing.
*/
void cleanupSWTDisplay();
}