001/** 002 * 003 * Copyright (c) 2014, the Railo Company Ltd. All rights reserved. 004 * 005 * This library is free software; you can redistribute it and/or 006 * modify it under the terms of the GNU Lesser General Public 007 * License as published by the Free Software Foundation; either 008 * version 2.1 of the License, or (at your option) any later version. 009 * 010 * This library is distributed in the hope that it will be useful, 011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 013 * Lesser General Public License for more details. 014 * 015 * You should have received a copy of the GNU Lesser General Public 016 * License along with this library. If not, see <http://www.gnu.org/licenses/>. 017 * 018 **/ 019package lucee.runtime.gateway.proxy; 020 021import java.io.IOException; 022import java.util.Map; 023 024import lucee.runtime.gateway.Gateway; 025import lucee.runtime.gateway.GatewayEnginePro; 026import lucee.runtime.gateway.GatewayPro; 027 028public class GatewayProxy implements GatewayPro { 029 030 private final Gateway gateway; 031 032 public GatewayProxy(Gateway gateway){ 033 this.gateway=gateway; 034 } 035 036 @Override 037 public void init(GatewayEnginePro engine, String id, String cfcPath, Map config) throws IOException { 038 gateway.init(GatewayProFactory.toGatewayEngine(engine), id, cfcPath, config); 039 } 040 041 042 @Override 043 public String getId() { 044 return gateway.getId(); 045 } 046 047 @Override 048 public String sendMessage(Map data) throws IOException { 049 return gateway.sendMessage(data); 050 } 051 052 @Override 053 public Object getHelper() { 054 return gateway.getHelper(); 055 } 056 057 @Override 058 public void doStart() throws IOException { 059 gateway.doStart(); 060 } 061 062 @Override 063 public void doStop() throws IOException { 064 gateway.doStop(); 065 } 066 067 @Override 068 public void doRestart() throws IOException { 069 gateway.doRestart(); 070 } 071 072 @Override 073 public int getState() { 074 return gateway.getState(); 075 } 076 077 public Gateway getGateway() { 078 return gateway; 079 } 080}