/** * Used by setAdapter and it removes the old adapter of the destination * and adds the new adapter. * * @param adapter The adapter for the destination. */ private void addAdapter(ServiceAdapter adapter) { removeAdapter(); this.adapter = adapter; if (adapter.getDestination() == null || adapter.getDestination() != this) adapter.setDestination(this); }
public String getId() { return serviceAdapter.getId(); }
/** * Stops the <code>ServiceAdapter</code>. * If subclasses override, they must call <code>super.start()</code>. * */ public void stop() { if (!isStarted()) { return; } super.stop(); // Remove management if (isManaged() && getDestination().isManaged()) { if (getControl() != null) { getControl().unregister(); setControl(null); } setManaged(false); } }
public void preDeregister() throws Exception { ServiceControl parent = (ServiceControl)getParentControl(); parent.removeDestination(getObjectName()); // Unregister adapter of the destination ServiceAdapter child = destination.getAdapter(); if (child.getControl() != null) { child.getControl().unregister(); child.setControl(null); child.setManaged(false); } super.preDeregister(); }
if (isStarted()) Destination destination = getDestination(); if (!destination.isStarted()) Log.getLogger(getLogCategory()).warn("Adapter with id '{0}' cannot be started" + " when its Destination with id '{1}' is not started.", new Object[]{getId(), destination.getId()}); if (isManaged() && destination.isManaged()) setupAdapterControl(destination); DestinationControl controller = (DestinationControl)destination.getControl(); if (getControl() != null) controller.setAdapter(getControl().getObjectName());
adapter.setId(id); adapter.setManaged(isManaged()); adapter.setDestination(this);
private void createAdapter(Destination destination, DestinationSettings destSettings, ServiceSettings svcSettings) { AdapterSettings adapterSettings = destSettings.getAdapterSettings(); String adapterId = adapterSettings.getId(); ServiceAdapter adapter = destination.createAdapter(adapterId); // Initialize with service, adapter and then destination properties adapter.initialize(adapterId, svcSettings.getProperties()); adapter.initialize(adapterId, adapterSettings.getProperties()); adapter.initialize(adapterId, destSettings.getProperties()); }
return adapter.invoke(message);
/** * * {@inheritDoc} */ @Override protected void initializeDestination(Destination destination) { String adapterId = StringUtils.hasText(destination.getAdapter().getId()) ? destination.getAdapter().getId() : getDestinationId() + "Adapter"; //As per FLEX-198, we're doing the opposite of the BlazeDS default and defaulting disallow-wildcard-subtopics to "true" if (!getServerMap().containsKey("disallow-wildcard-subtopics")) { getServerMap().addProperty("disallow-wildcard-subtopics", "true"); } destination.getAdapter().initialize(adapterId, getProperties()); destination.initialize(getDestinationId(), getProperties()); destination.start(); }
/** * Casts the <code>Destination</code> into <code>HTTPProxyDestination</code> * and calls super.setDestination. * @param destination The HTTP proxy destination. */ public void setDestination(Destination destination) { Destination dest = (HTTPProxyDestination) destination; super.setDestination(dest); }
/** * Sets the <code>Destination</code> of the <code>ServiceAdapter</code>. * Also sets the <code>ServiceAdapter</code> of the <code>Destination</code> * if needed. * * @param destination The <code>Destination</code> of the <code>ServiceAdapter</code>. */ public void setDestination(Destination destination) { Destination oldDestination = getDestination(); setParent(destination); if (oldDestination != null) oldDestination.setAdapter(null); // Set destination's adapter if needed if (destination.getAdapter() != this) { destination.setAdapter(this); } }
if (adapter.handlesSubscriptions()) replyMessage = (Message) adapter.manage(command); if (adapter.handlesSubscriptions()) replyMessage = (Message) adapter.manage(command); if (adapter.handlesSubscriptions()) replyMessage = (Message) adapter.manage(command); if (adapter.handlesSubscriptions()) List missedMessages = (List)adapter.manage(command); if (missedMessages != null && !missedMessages.isEmpty())
/** {@inheritDoc} */ @Override public void start() { if (isStarted()) { return; } super.start(); validateInstanceSettings(); RemotingDestination remotingDestination = (RemotingDestination) getDestination(); if (FlexFactory.SCOPE_APPLICATION.equals(remotingDestination.getScope())) { FactoryInstance factoryInstance = remotingDestination.getFactoryInstance(); createInstance(factoryInstance.getInstanceClass()); } }
/** * Returns the <code>Destination</code> of the <code>ServiceAdapter</code>. * * @return The <code>Destination</code> of the <code>ServiceAdapter</code>. */ public Destination getDestination() { return (Destination)getParent(); }
if (isStarted()) Destination destination = getDestination(); if (!destination.isStarted()) Log.getLogger(getLogCategory()).warn("Adapter with id '{0}' cannot be started" + " when its Destination with id '{1}' is not started.", new Object[]{getId(), destination.getId()}); if (isManaged() && destination.isManaged()) setupAdapterControl(destination); DestinationControl controller = (DestinationControl)destination.getControl(); if (getControl() != null) controller.setAdapter(getControl().getObjectName());
adapter.setId(id); adapter.setManaged(isManaged()); adapter.setDestination(this);
private void createAdapter(Destination destination, DestinationSettings destSettings, ServiceSettings svcSettings) { AdapterSettings adapterSettings = destSettings.getAdapterSettings(); String adapterId = adapterSettings.getId(); ServiceAdapter adapter = destination.createAdapter(adapterId); // Initialize with service, adapter and then destination properties adapter.initialize(adapterId, svcSettings.getProperties()); adapter.initialize(adapterId, adapterSettings.getProperties()); adapter.initialize(adapterId, destSettings.getProperties()); }
return adapter.invoke(message);