001 package railo.runtime.gateway.proxy; 002 003 import railo.runtime.gateway.Gateway; 004 import railo.runtime.gateway.GatewayEngine; 005 import railo.runtime.gateway.GatewayEngineImpl; 006 import railo.runtime.gateway.GatewayEnginePro; 007 import railo.runtime.gateway.GatewayPro; 008 009 // FUTURE remove this class 010 public class GatewayProFactory { 011 012 public static GatewayPro toGatewayPro(Gateway gateway){ 013 return new GatewayProxy(gateway); 014 } 015 016 017 public static Gateway toGateway(GatewayPro gateway){ 018 return ((GatewayProxy)gateway).getGateway(); 019 } 020 021 public static GatewayPro toGatewayPro(Object gateway){ 022 if(gateway instanceof GatewayPro) return (GatewayPro) gateway; 023 return new GatewayProxy(gateway); 024 } 025 026 public static GatewayEngineImpl toGatewayEngineImpl(GatewayEnginePro engine) { 027 if(engine instanceof GatewayEngineImpl)return (GatewayEngineImpl) engine; 028 return ((GatewayEngineProxy) engine).getEngine(); 029 } 030 031 032 public static GatewayEngine toGatewayEngine(GatewayEnginePro engine) { 033 return new GatewayEngineProxy((GatewayEngineImpl) engine); 034 } 035 }