Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH212 - mobile streaming/polling disconnect issue #312

Open
wants to merge 1 commit into
base: GH139-jmx-activated
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -234,13 +234,11 @@ package org.flowerplatform.flexutil.mobile.view_content_host {
}
});

if (parentActionId == null) {
// give the viewMenuItems to the actions so that it can calculate it's enablement
openMenuAction.viewMenuItems = newViewMenuItems;
viewMenuItems = newViewMenuItems;
// give the viewMenuItems to the actions so that it can calculate it's enablement
openMenuAction.viewMenuItems = newViewMenuItems;
viewMenuItems = newViewMenuItems;

appendToActionContent(newActionContent);
}
appendToActionContent(newActionContent);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
<!--
Number of milliseconds to wait to write an empty message to the client.
In current context it does not really help us.
IMPORTANT FOR MOBILE: use value <= 1500 on mobile, otherwise it disconnects periodically
<server-to-client-heartbeat-millis>10000</server-to-client-heartbeat-millis>

If nothing is sent to the client, the server will disconnect the client.
Expand Down
6 changes: 3 additions & 3 deletions org.flowerplatform.web.mobile/.actionScriptProperties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<actionScriptProperties analytics="false" mainApplicationPath="MainMobile.mxml" projectUUID="926fcd05-466e-4f98-aac9-736697c44ab5" version="10">
<compiler additionalCompilerArguments="-locale en_US -services &quot;../../org.flowerplatform.web.app\WebContent\WEB-INF\flex\services-config.xml&quot; -context-root org.flowerplatform.web.app -include-libraries+=../../org.flowerplatform.flexutil/bin/org.flowerplatform.flexutil.swc -include-libraries+=../../org.flowerplatform.flexutil_legacy/bin/org.flowerplatform.flexutil_legacy.swc -include-libraries+=../../org.flowerplatform.common/public-resources/swc/org.flowerplatform.common.swc" autoRSLOrdering="true" copyDependentFiles="true" fteInMXComponents="false" generateAccessible="false" htmlExpressInstall="true" htmlGenerate="false" htmlHistoryManagement="false" htmlPlayerVersionCheck="true" includeNetmonSwc="false" outputFolderPath="bin" removeUnusedRSL="true" sourceFolderPath="src" strict="true" targetPlayerVersion="0.0.0" useApolloConfig="true" useDebugRSLSwfs="true" verifyDigests="true" warn="true">
<compiler additionalCompilerArguments="-locale en_US -services &quot;..\WebContent\WEB-INF\flex\services-config.xml&quot; -context-root org.flowerplatform.web.app -include-libraries+=../../org.flowerplatform.flexutil/bin/org.flowerplatform.flexutil.swc -include-libraries+=../../org.flowerplatform.flexutil_legacy/bin/org.flowerplatform.flexutil_legacy.swc -include-libraries+=../../org.flowerplatform.common/public-resources/swc/org.flowerplatform.common.swc" autoRSLOrdering="true" copyDependentFiles="true" fteInMXComponents="false" generateAccessible="false" htmlExpressInstall="true" htmlGenerate="false" htmlHistoryManagement="false" htmlPlayerVersionCheck="true" includeNetmonSwc="false" outputFolderPath="bin" removeUnusedRSL="true" sourceFolderPath="src" strict="true" targetPlayerVersion="0.0.0" useApolloConfig="true" useDebugRSLSwfs="true" verifyDigests="true" warn="true">
<compilerSourcePath/>
<libraryPath defaultLinkType="0">
<libraryPathEntry kind="4" path="">
Expand All @@ -19,9 +19,9 @@
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/spark_dmv.swc" useDefaultLinkType="false"/>
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation.swc" useDefaultLinkType="false"/>
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation_dmv.swc" useDefaultLinkType="false"/>
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/air/airframework.swc" useDefaultLinkType="false"/>
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/air/applicationupdater_ui.swc" useDefaultLinkType="false"/>
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation_flashflexkit.swc" useDefaultLinkType="false"/>
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/air/applicationupdater_ui.swc" useDefaultLinkType="false"/>
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/air/airframework.swc" useDefaultLinkType="false"/>
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation_agent.swc" useDefaultLinkType="false"/>
</excludedEntries>
</libraryPathEntry>
Expand Down
3 changes: 3 additions & 0 deletions org.flowerplatform.web.mobile/WebContent/WEB-INF/all.policy
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
grant {
permission java.security.AllPermission;
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<service id="activity-remoting-service" class="flex.messaging.services.RemotingService">

<adapters>
<adapter-definition id="java-object" class="flex.messaging.services.remoting.adapters.JavaAdapter" default="true"/>
</adapters>

<destination id="activityService">
<channels>
<channel ref="activityServiceAmf"/>
</channels>
<properties>
<source>com.crispico.flower.mp.web.activitywelcomescreen.ActivityService</source>
</properties>
</destination>

</service>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<service id="message-service" class="flex.messaging.services.MessageService">

<adapters>
<adapter-definition id="communicationMessagingAdapter" class="org.flowerplatform.blazeds.channel.CommunicationChannelMessagingAdapter" />
</adapters>

<destination id="blazedsSecuredDestination">
<security>
<security-constraint ref="tomcatSecurityConstraint"/>
</security>

<channels>
<channel ref="blazedsLongPollingAMFChannel" />
</channels>

<adapter ref="communicationMessagingAdapter" />
</destination>
</service>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<service id="register-user-remoting-service" class="flex.messaging.services.RemotingService">

<adapters>
<adapter-definition id="java-object" class="flex.messaging.services.remoting.adapters.JavaAdapter" default="true"/>
</adapters>

<destination id="registerUserService">
<channels>
<channel ref="registerUserServiceAmf"/>
</channels>
<properties>
<source>org.flowerplatform.web.security.service.RegisterUserService</source>
</properties>
</destination>

</service>
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
<?xml version="1.0" encoding="UTF-8"?>
<services-config>

<services>
<service-include file-path="messaging-config.xml" />
<service-include file-path="register-user-remoting-config.xml" />
<!-- <service-include file-path="activity-remoting-config.xml" /> -->
</services>

<security>

<!-- This object will be responsible for authorization and authentication on server side. -->
<login-command class="org.flowerplatform.blazeds.TomcatLoginCommand" server="all">
<!-- Based on this property, multiple users can be logged into the system, using the same browser and more tabs.
If true when opening a new tab, the session is not shared with the other tab.
More informations can be found at http://livedocs.adobe.com/blazeds/1/blazeds_devguide/help.html?content=services_security_5.html
We keep it true because otherwise logging out from a tab made also a logout on a different tab in the same browser. -->
<per-client-authentication>true</per-client-authentication>
</login-command>

<security-constraint id="tomcatSecurityConstraint">
<!-- The Custom value is used in order to use the Flex's application authentication and not the Browser's authentication.
More details in http://livedocs.adobe.com/blazeds/1/blazeds_devguide/help.html?content=services_security_2.html. -->
<auth-method>Custom</auth-method>
</security-constraint>
</security>

<!-- For more details about channel definition configuration check http://livedocs.adobe.com/livecycle/8.2/programLC/programmer/lcds/help.html?content=lcconfig_3.html. -->
<channels>

<!-- We will also define a Long Polling AMF Channel because it is capable of pulling new messages from the server by requesting at a given interval of time.
For more details check "Configuring channels with servlet-based endpoints" section in http://livedocs.adobe.com/livecycle/8.2/programLC/programmer/lcds/help.html?content=lcconfig_3.html. -->
<channel-definition id="blazedsLongPollingAMFChannel"
class="mx.messaging.channels.AMFChannel">
<endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amflongpolling"
class="org.flowerplatform.blazeds.endpoint.FlowerWebSecureAMFEndpoint" />

<!-- The following are properties for configuring the polling.
For more details check table in the "Configuring channels with servlet-based endpoints" section in http://livedocs.adobe.com/livecycle/8.2/programLC/programmer/lcds/help.html?content=lcconfig_3.html. -->
<properties>
<!-- Enable polling on the amf channel. -->
<polling-enabled>true</polling-enabled>

<!-- It should poll as soon as possible from the server. -->
<polling-interval-millis>0</polling-interval-millis>

<!--
IMPORTANT FOR MOBILE
The server must send a ping to client more often than 60000 milliseconds (default value).
Otherwise, the client is disconnected before starting the polling, after 30-40 seconds.

@author Cristina Constantinescu
-->
<wait-interval-millis>30000</wait-interval-millis>

<!-- Maximum number of waiting threads. When this limit is exceeded a poll request automatically responds immediately . -->
<max-waiting-poll-requests>200</max-waiting-poll-requests>

<!-- If the client gets the chance to send a disconnect message to the server, the session will be invalidated,
which means that the user must authenticate again next time when it connects.
We keep it false because it also logs out from a different tab in the same browser.-->
<invalidate-session-on-disconnect>false</invalidate-session-on-disconnect>
<serialization>
<log-property-errors>true</log-property-errors>
</serialization>
</properties>
</channel-definition>

<channel-definition id="registerUserServiceAmf" class="mx.messaging.channels.AMFChannel">
<endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/register-user-amf" class="flex.messaging.endpoints.AMFEndpoint"/>
<properties>
<polling-enabled>false</polling-enabled>
</properties>
</channel-definition>

<!-- <channel-definition id="activityServiceAmf" class="mx.messaging.channels.AMFChannel"> -->
<!-- <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/activity-amf" class="flex.messaging.endpoints.AMFEndpoint"/> -->
<!-- <properties> -->
<!-- <polling-enabled>false</polling-enabled> -->
<!-- </properties> -->
<!-- </channel-definition> -->

</channels>

<logging>
<!-- You may also use flex.messaging.log.ServletLogTarget -->
<target class="org.flowerplatform.blazeds.FlowerConsoleTarget" level="Warn"> <!-- Other options : Debug, All, Warn -->
<properties>
<prefix>[BlazeDS Flower Web] </prefix>
<includeDate>false</includeDate>
<includeTime>false</includeTime>
<includeLevel>false</includeLevel>
<includeCategory>true</includeCategory>
</properties>
<filters>
<pattern>*</pattern>
<pattern>Endpoint.*</pattern>
<pattern>Service.*</pattern>
<pattern>Configuration</pattern>
</filters>
</target>
</logging>

<!-- <system> -->
<!-- <redeploy> -->
<!-- <enabled>true</enabled> -->
<!-- <watch-interval>20</watch-interval> -->
<!-- <watch-file>{context.root}/WEB-INF/flex/services-config.xml</watch-file> -->
<!-- <watch-file>{context.root}/WEB-INF/flex/proxy-config.xml</watch-file> -->
<!-- <watch-file>{context.root}/WEB-INF/flex/remoting-config.xml</watch-file> -->
<!-- <watch-file>{context.root}/WEB-INF/flex/messaging-config.xml</watch-file> -->
<!-- <touch-file>{context.root}/WEB-INF/web.xml</touch-file> -->
<!-- </redeploy> -->
<!-- </system> -->
</services-config>
112 changes: 112 additions & 0 deletions org.flowerplatform.web.mobile/WebContent/WEB-INF/web.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
<display-name>org.flowerplatform.web.app</display-name>
<servlet id="bridge">
<servlet-name>equinoxbridgeservlet</servlet-name>
<servlet-class>org.eclipse.equinox.servletbridge.BridgeServlet</servlet-class>
<init-param>
<param-name>commandline</param-name>
<param-value>-console -consoleLog</param-value>
</init-param>
<init-param>
<param-name>enableFrameworkControls</param-name>
<param-value>true</param-value>
</init-param>
<!--
org.eclipse.equinox.servletbridge and the Servlet API are exported automatically to the underlying OSGi framework.
The extendedFrameworkExports parameter allows the specification of additional java package exports.
The format is a comma separated list of exports as specified by the "Export-Package" bundle manifest header.
For example: com.mycompany.exports; version=1.0.0, com.mycompany.otherexports; version=1.0.0
-->
<init-param>
<param-name>extendedFrameworkExports</param-name>
<param-value></param-value>
</init-param>

<!--
You can specify your own framework launcher here.
The default is: org.eclipse.equinox.servletbridge.FrameworkLauncher
-->
<init-param>
<param-name>frameworkLauncherClass</param-name>
<param-value>org.flowerplatform.web.app.FlowerFrameworkLauncher</param-value>
</init-param>

<!--
If set, starts in dev. mode. The name of the Eclipse launch configuration.
The configuration file path and the properties osgi.configuration.area,
osgi.dev are generated based on this info,
pointing to the development workspace; it is something like
...eclipse_workspace_fmp/.metadata/.plugins/org.eclipse.pde.core/Flower MP - Web

NOTE1: The below configuration needs to be launched manually at least once
before launching Tomcat (in order to have the proper files generated). It
needs to be relaunched as well when this config changes (e.g. new plugins
are added).

NOTE2: In dev. mode the webapp's context is something like
eclipse_workspace_fmp\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\org.flowerplatform.web.app\
-->
<init-param>
<param-name>developmentLaunchConfigurationWindows</param-name>
<param-value>Flower Platform - Web (write plugin config to file)</param-value>
</init-param>
<init-param>
<param-name>developmentLaunchConfigurationLinux</param-name>
<param-value>Flower Platform - Web Linux</param-value>
</init-param>

<!--
If in production mode (i.e. no dev mode, i.e. developmentLaunchConfiguration not set),
points to the location of the eclipse configuration files; this directory is used as
osgi.configuration.area. This directory (probably ...eclipse/configuration):
* should contain config.ini;
* may contain (although not mandatory of course) dev.ini, that will be used if found;
* ../plugins should contain the FDC plugins.

If in dev mode, this parameter is ignored.
-->
<init-param>
<param-name>eclipseConfigurationLocation</param-name>
<param-value>WEB-INF/eclipse/configuration</param-value>
</init-param>

<!--
Mandatory. The location (relative to the webapp's context) where to find the
Eclipse workspace to be used.

In dev. mode, this is relative the dev workspace.
-->
<init-param>
<param-name>workspaceLocation</param-name>
<param-value>../git_repo_fp/org.flowerplatform.web.app/workspace</param-value>
</init-param>

<load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
<servlet-name>equinoxbridgeservlet</servlet-name>
<url-pattern>/messagebroker/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>equinoxbridgeservlet</servlet-name>
<url-pattern>/servlet/*</url-pattern>
</servlet-mapping>

<session-config>
<!-- For the session represents the number of minutes after the session is invalidated. -->
<session-timeout>10</session-timeout>
</session-config>

<!-- Http Flex Session attribute and binding listener support
TODO Sorin : pare sa nu mearga, zice in consola ca trebuie inregistrat acest listener, nush ce face el exact.
<listener>
<listener-class>flex.messaging.HttpFlexSession</listener-class>
</listener>
-->

<welcome-file-list>
<welcome-file>main.jsp</welcome-file>
</welcome-file-list>
</web-app>
Loading