@Override
    public void createGateway(Config config) throws ClassException, PageException, BundleException {
	if (gateway == null) {
	    if (classDefintion != null && classDefintion.hasClass()) {
		Class clazz = classDefintion.getClazz();

		gateway = GatewayFactory.toGateway(ClassUtil.loadInstance(clazz));
	    }
	    else if (!StringUtil.isEmpty(cfcPath)) {
		gateway = new CFCGateway(cfcPath);
	    }
	    else throw new ApplicationException("missing gateway source definitions");
	    try {
		// new GatewayThread(engine,gateway,GatewayThread.START).run();
		gateway.init(engine, getId(), getListenerCfcPath(), getCustom());
		if (getStartupMode() == GatewayEntry.STARTUP_MODE_AUTOMATIC) {
		    new GatewayThread(engine, gateway, GatewayThread.START).start();
		    /*
		     * try{ //gateway.doStart(); } catch(GatewayException ge){
		     * engine.log(gateway,GatewayEngine.LOGLEVEL_ERROR, ge.getMessage()); }
		     */
		}
	    }
	    catch (IOException ioe) {
		throw Caster.toPageException(ioe);
	    }
	}
    }
@ Override public void createGateway ( Config config ) throws ClassException , PageException , BundleException { if ( gateway == null ) { if ( classDefintion != null && classDefintion . hasClass ( ) ) { Class clazz = classDefintion . getClazz ( ) ; gateway = GatewayFactory . toGateway ( ClassUtil . loadInstance ( clazz ) ) ; } else if ( ! StringUtil . isEmpty ( cfcPath ) ) { gateway = new CFCGateway ( cfcPath ) ; } else throw new ApplicationException ( "missing gateway source definitions" ) ; try { gateway . init ( engine , getId ( ) , getListenerCfcPath ( ) , getCustom ( ) ) ; if ( getStartupMode ( ) == GatewayEntry . STARTUP_MODE_AUTOMATIC ) { new GatewayThread ( engine , gateway , GatewayThread . START ) . start ( ) ; } } catch ( IOException ioe ) { throw Caster . toPageException ( ioe ) ; } } }
@return the gateway
@throws ClassException
@throws PageException
@throws BundleException