@Override protected Adapter buildAdapter() { return new Adapter("jms-adapter", "org.granite.gravity.adapters.JMSServiceAdapter", new XMap()); }
protected OSGiDestinationSimple() { super(null, new ArrayList<String>(), new XMap(), new ArrayList<String>(), null, null); }
@Override protected Adapter buildAdapter() { return new Adapter("activemq-adapter", "org.granite.gravity.adapters.ActiveMQServiceAdapter", new XMap()); }
protected Adapter buildAdapter() { return new Adapter("simple-adapter", "org.granite.gravity.adapters.SimpleServiceAdapter", new XMap()); }
protected OSGiDestinationFactory() { super(null, new ArrayList<String>(), new XMap(), new ArrayList<String>(), null, null); }
protected OSGiDestinationAdapter() { super(null, new ArrayList<String>(), new XMap(), new ArrayList<String>(), null, null); }
protected Destination buildDestination() { List<String> channelIds = new ArrayList<String>(); channelIds.add("graniteamf"); Destination destination = new Destination(source, channelIds, new XMap(), roles, null, null); if (securizer != null) destination.setSecurizer(securizer); return destination; } }
private void loadConfig(InputStream configIs) throws IOException, SAXException { XMap doc = new XMap(configIs); forElement(doc); }
private void loadConfig(InputStream configIs) throws IOException, SAXException { XMap doc = new XMap(configIs); forElement(doc); }
protected Destination buildDestination(Adapter adapter) { List<String> channelIds = new ArrayList<String>(); channelIds.add("gravityamf"); Destination destination = new Destination(id, channelIds, new XMap(), roles, adapter, null); destination.getProperties().put("no-local", String.valueOf(noLocal)); destination.getProperties().put("session-selector", String.valueOf(sessionSelector)); if (getSecurizerClassName() != null) destination.getProperties().put("securizer", securizerClassName); if (getSecurizer() != null) destination.setSecurizer(getSecurizer()); return destination; } }
public static Factory forElement(XMap element) { String id = element.get("@id"); String className = element.get("@class"); XMap properties = new XMap(element.getOne("properties")); return new Factory(id, className, properties); } }
public void initServices(ServicesConfig servicesConfig) { Channel channel = servicesConfig.findChannelById("graniteamf"); if (channel == null) { channel = new Channel("graniteamf", "mx.messaging.channels.AMFChannel", new EndPoint("http://{server.name}:{server.port}/{context.root}/graniteamf/amf", "flex.messaging.endpoints.AMFEndpoint"), new XMap()); servicesConfig.addChannel(channel); } List<Service> services = servicesConfig.findServicesByMessageType("flex.messaging.messages.RemotingMessage"); Service service = null; if (services == null || services.isEmpty()) { service = new Service("granite-service", "flex.messaging.services.RemotingService", "flex.messaging.messages.RemotingMessage", null, null, new HashMap<String, Destination>()); servicesConfig.addService(service); } else service = services.get(0); service.getDestinations().put(source, buildDestination()); log.info("Registered remote destination %s", source); }
public static Factory forElement(XMap element) { String id = element.get("@id"); String className = element.get("@class"); XMap properties = new XMap(element.getOne("properties")); return new Factory(id, className, properties); } }
public static Adapter forElement(XMap element) { String id = element.get("@id"); String className = element.get("@class"); XMap properties = new XMap(element.getOne("properties")); return new Adapter(id, className, properties); } }
public static Adapter forElement(XMap element) { String id = element.get("@id"); String className = element.get("@class"); XMap properties = new XMap(element.getOne("properties")); return new Adapter(id, className, properties); } }
public static Channel forElement(XMap element) { String id = element.get("@id"); String className = element.get("@class"); XMap endPointElt = element.getOne("endpoint"); if (endPointElt == null) throw new RuntimeException("Excepting a 'endpoint' element in 'channel-definition': " + id); EndPoint endPoint = EndPoint.forElement(endPointElt); XMap properties = new XMap(element.getOne("properties")); return new Channel(id, className, endPoint, properties); } }
public static Channel forElement(XMap element) { String id = element.get("@id"); String className = element.get("@class"); XMap endPointElt = element.getOne("endpoint"); if (endPointElt == null) throw new RuntimeException("Excepting a 'endpoint' element in 'channel-definition': " + id); EndPoint endPoint = EndPoint.forElement(endPointElt); XMap properties = new XMap(element.getOne("properties")); return new Channel(id, className, endPoint, properties); } }
public static Destination forElement(XMap element, Adapter defaultAdapter, Map<String, Adapter> adaptersMap) { String id = element.get("@id"); List<String> channelRefs = new ArrayList<String>(); for (XMap channel : element.getAll("channels/channel[@ref]")) channelRefs.add(channel.get("@ref")); XMap properties = new XMap(element.getOne("properties")); List<String> rolesList = null; if (element.containsKey("security/security-constraint/roles/role")) { rolesList = new ArrayList<String>(); for (XMap role : element.getAll("security/security-constraint/roles/role")) rolesList.add(role.get(".")); } XMap adapter = element.getOne("adapter[@ref]"); Adapter adapterRef = adapter != null && adaptersMap != null ? adaptersMap.get(adapter.get("@ref")) : defaultAdapter; return new Destination(id, channelRefs, properties, rolesList, adapterRef, null); } }
public static Destination forElement(XMap element, Adapter defaultAdapter, Map<String, Adapter> adaptersMap) { String id = element.get("@id"); List<String> channelRefs = new ArrayList<String>(); for (XMap channel : element.getAll("channels/channel[@ref]")) channelRefs.add(channel.get("@ref")); XMap properties = new XMap(element.getOne("properties")); List<String> rolesList = null; if (element.containsKey("security/security-constraint/roles/role")) { rolesList = new ArrayList<String>(); for (XMap role : element.getAll("security/security-constraint/roles/role")) rolesList.add(role.get(".")); } XMap adapter = element.getOne("adapter[@ref]"); Adapter adapterRef = adapter != null && adaptersMap != null ? adaptersMap.get(adapter.get("@ref")) : defaultAdapter; return new Destination(id, channelRefs, properties, rolesList, adapterRef, null); } }
@Override public void configure(XMap properties) throws ServiceException { String sServiceExceptionHandler = properties.get("service-exception-handler"); if (sServiceExceptionHandler == null) { XMap props = new XMap(properties); props.put("service-exception-handler", ExtendedServiceExceptionHandler.class.getName()); super.configure(props); } else super.configure(properties); GraniteConfig config = GraniteContext.getCurrentInstance().getGraniteConfig(); config.registerExceptionConverter(PersistenceExceptionConverter.class); config.registerExceptionConverter(EJBAccessExceptionConverter.class); this.lookup = properties.get("lookup"); }