Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

refactoring

  • Loading branch information...
commit f31496d93c91cb940d2301a9ddf7971f2b4fba2e 1 parent c634384
@alextkachman alextkachman authored
Showing with 2,892 additions and 1,701 deletions.
  1. +16 −0 Examples/_._._toImprove/Load10x100k.groovy
  2. +9 −9 Examples/_._._toImprove/chat/build.gradle
  3. +9 −9 Examples/_._._toImprove/chat/src/org/mbte/chat/ChatAppModule.groovy
  4. +9 −9 Examples/_._._toImprove/chat/src/org/mbte/chat/ChatApplication.groovy
  5. +9 −9 Examples/_._._toImprove/chat/src/org/mbte/chat/LoginService.groovy
  6. +9 −9 Examples/_._._toImprove/chat/src/org/mbte/chat/model/Conversation.groovy
  7. +9 −9 Examples/_._._toImprove/chat/src/org/mbte/chat/model/ConversationDAO.groovy
  8. +9 −9 Examples/_._._toImprove/chat/src/org/mbte/chat/model/MongoDatastore.groovy
  9. +10 −10 Examples/_._._toImprove/chat/src/org/mbte/chat/model/User.groovy
  10. +9 −9 Examples/_._._toImprove/chat/src/org/mbte/chat/model/UserDAO.groovy
  11. +9 −9 Examples/_._._toImprove/chat/tests/org/mbte/chat/ChatAppTest.groovy
  12. +9 −9 Examples/_._._toImprove/chat/tests/org/mbte/chat/ConversationTest.groovy
  13. +9 −9 Examples/_._._toImprove/chat/tests/org/mbte/chat/ServerTest.groovy
  14. +9 −9 Examples/_._._toImprove/chat/tests/org/mbte/chat/UserTest.groovy
  15. +16 −0 Examples/_._._toImprove/groovychat/PureGroovyHttpServer.groovy
  16. +16 −0 Examples/_._._toImprove/groovychat/static/js/application.js
  17. +16 −0 Examples/_._._toImprove/index.html
  18. +16 −0 Examples/_._._toImprove/mapserver/HashMapServer.groovy
  19. +16 −0 Examples/_._._toImprove/webkvstore/GrettyWebKeyStore.groovy
  20. +16 −0 Examples/_._._toImprove/webkvstore/static/webkvstore.html
  21. +16 −0 Examples/_._._toImprove/websockets/GrettyTest.groovy
  22. +16 −0 Examples/_._._toImprove/websockets/lifeFiles/js/life.js
  23. +16 −0 Examples/_._._toImprove/websockets/lifeFiles/life.html
  24. +16 −0 Examples/_._._toImprove/websockets/rootFiles/index.html
  25. +16 −0 Examples/_._._toImprove/websockets/rootFiles/js/prototype.js
  26. +16 −0 Examples/_._._toImprove/websockets/rootFiles/js/pseudows.js
  27. +16 −0 Examples/_._._toImprove/websockets/webSocketsFiles/ws.html
  28. +10 −10 Examples/echoserver/Echo.groovy
  29. +20 −1 Examples/helloworld/GppSimpleHttpServer.groovy
  30. +35 −25 Examples/helloworld/GroovySimpleHttpServer.groovy
  31. +47 −31 Examples/helloworld/JavaSimpleHttpServer.java
  32. +17 −1 Examples/helloworld/myapp/default.groovy
  33. +16 −0 Examples/helloworld/web/static/gindex.html
  34. +16 −0 Examples/helloworld/web/templates/line.gpp
  35. +59 −25 build.gradle
  36. +9 −9 gradle-wrapper.properties
  37. +2 −2 gretty-hazelcast/tests/org/mbte/gretty/hazelcast/ClusterTest.groovy
  38. +1 −1  gretty-hazelcast/tests/org/mbte/gretty/hazelcast/SessionsTest.groovy
  39. +24 −0 gretty-scala/build.gradle
  40. +55 −0 gretty-scala/gretty-scala.iml
  41. +120 −0 gretty-scala/src/org/mbte/gretty/scala/TcpClient.scala
  42. +89 −0 gretty-scala/src/org/mbte/gretty/scala/TcpServer.scala
  43. +80 −0 gretty-scala/tests/org/mbte/gretty/GrettyScalaTest.scala
  44. +209 −0 gretty.ipr
  45. +10 −10 gretty/build.gradle
  46. +22 −26 gretty/gretty.iml
  47. +601 −585 gretty/src/META-INF/socket.io/FABridge.js
  48. +9 −9 gretty/src/META-INF/socket.io/json.js
  49. +9 −9 gretty/src/META-INF/socket.io/sample.html
  50. +16 −0 gretty/src/META-INF/socket.io/socket.io.js
  51. +17 −1 gretty/src/META-INF/socket.io/swfobject.js
  52. +15 −4 gretty/src/META-INF/socket.io/web_socket.js
  53. +14 −26 gretty/src/org/mbte/gretty/AbstractClient.groovy
  54. +31 −31 gretty/src/org/mbte/gretty/AbstractServer.groovy
  55. +95 −0 gretty/src/org/mbte/gretty/BaseChannelHandler.groovy
  56. +10 −10 gretty/src/org/mbte/gretty/JacksonCategory.groovy
  57. +10 −10 gretty/src/org/mbte/gretty/httpclient/AbstractClientHandler.groovy
  58. +12 −15 gretty/src/org/mbte/gretty/httpclient/AbstractHttpClient.groovy
  59. +10 −10 gretty/src/org/mbte/gretty/httpclient/AbstractHttpClientHandler.groovy
  60. +10 −10 gretty/src/org/mbte/gretty/httpclient/GrettyClient.groovy
  61. +10 −10 gretty/src/org/mbte/gretty/httpclient/GrettyWebsocketClient.groovy
  62. +10 −10 gretty/src/org/mbte/gretty/httpclient/HttpClientPool.groovy
  63. +47 −19 gretty/src/org/mbte/gretty/httpclient/HttpRequestHelper.groovy
  64. +10 −10 gretty/src/org/mbte/gretty/httpclient/LoadGenerator.groovy
  65. +10 −10 gretty/src/org/mbte/gretty/httpserver/FileWriteHandler.groovy
  66. +10 −10 gretty/src/org/mbte/gretty/httpserver/FlashPolicyFileHandler.groovy
  67. +10 −10 gretty/src/org/mbte/gretty/httpserver/GrettyAppHandler.groovy
  68. +10 −10 gretty/src/org/mbte/gretty/httpserver/GrettyAsyncFunction.groovy
  69. +16 −11 gretty/src/org/mbte/gretty/httpserver/GrettyContext.groovy
  70. +11 −11 gretty/src/org/mbte/gretty/httpserver/GrettyHttpHandler.groovy
  71. +12 −10 gretty/src/org/mbte/gretty/httpserver/GrettyHttpRequest.groovy
  72. +12 −10 gretty/src/org/mbte/gretty/httpserver/GrettyHttpResponse.groovy
  73. +10 −10 gretty/src/org/mbte/gretty/httpserver/GrettyIoSocketHandler.groovy
  74. +10 −10 gretty/src/org/mbte/gretty/httpserver/GrettyProxy.groovy
  75. +10 −10 gretty/src/org/mbte/gretty/httpserver/GrettyProxyClient.groovy
  76. +10 −10 gretty/src/org/mbte/gretty/httpserver/GrettyPublicDescription.groovy
  77. +10 −10 gretty/src/org/mbte/gretty/httpserver/GrettyRequestDecoder.groovy
  78. +10 −10 gretty/src/org/mbte/gretty/httpserver/GrettyRequestEncoder.groovy
  79. +10 −10 gretty/src/org/mbte/gretty/httpserver/GrettyResponseDecoder.groovy
  80. +10 −10 gretty/src/org/mbte/gretty/httpserver/GrettyResponseEncoder.groovy
  81. +10 −10 gretty/src/org/mbte/gretty/httpserver/GrettyRestDescription.groovy
  82. +91 −31 gretty/src/org/mbte/gretty/httpserver/GrettyServer.groovy
  83. +10 −10 gretty/src/org/mbte/gretty/httpserver/GrettyWebSocketEvent.groovy
  84. +10 −10 gretty/src/org/mbte/gretty/httpserver/GrettyWebSocketHandler.groovy
  85. +10 −10 gretty/src/org/mbte/gretty/httpserver/HttpChunkedStream.groovy
  86. +10 −10 gretty/src/org/mbte/gretty/httpserver/HttpLoggingHandler.groovy
  87. +24 −10 gretty/src/org/mbte/gretty/httpserver/IoMonitor.groovy
  88. +10 −10 gretty/src/org/mbte/gretty/httpserver/SocketIO.groovy
  89. +10 −10 gretty/src/org/mbte/gretty/httpserver/session/GrettyInMemorySessionManager.groovy
  90. +10 −10 gretty/src/org/mbte/gretty/httpserver/session/GrettySession.groovy
  91. +10 −10 gretty/src/org/mbte/gretty/httpserver/session/GrettySessionManager.groovy
  92. +10 −10 gretty/src/org/mbte/gretty/httpserver/template/GrettyTemplateEngine.groovy
  93. +10 −10 gretty/src/org/mbte/gretty/httpserver/template/GrettyTemplateScript.groovy
  94. +10 −10 gretty/src/org/mbte/gretty/memserver/Command.groovy
  95. +10 −10 gretty/src/org/mbte/gretty/memserver/GET.groovy
  96. +10 −10 gretty/src/org/mbte/gretty/memserver/MapClient.groovy
  97. +10 −10 gretty/src/org/mbte/gretty/memserver/MapServer.groovy
  98. +10 −10 gretty/src/org/mbte/gretty/memserver/SET.groovy
  99. +10 −10 gretty/src/org/mbte/gretty/pubsub/Publisher.groovy
  100. +10 −10 gretty/src/org/mbte/gretty/pubsub/Subscriber.groovy
  101. +10 −10 gretty/src/org/mbte/gretty/pubsub/SubscriptionNode.groovy
  102. +10 −10 gretty/src/org/mbte/gretty/remote/ClientConnector.groovy
  103. +10 −10 gretty/src/org/mbte/gretty/remote/ClusterClient.groovy
  104. +10 −10 gretty/src/org/mbte/gretty/remote/ClusterDiscoveryListener.groovy
  105. +10 −10 gretty/src/org/mbte/gretty/remote/ClusterNode.groovy
  106. +10 −10 gretty/src/org/mbte/gretty/remote/ClusterServer.groovy
  107. +10 −10 gretty/src/org/mbte/gretty/remote/RemoteClusterNode.groovy
  108. +10 −10 gretty/src/org/mbte/gretty/remote/RemoteConnectionHandler.groovy
  109. +10 −10 gretty/src/org/mbte/gretty/remote/RemoteMessage.groovy
  110. +10 −10 gretty/src/org/mbte/gretty/remote/WithRemoteId.groovy
  111. +10 −10 gretty/src/org/mbte/gretty/remote/inet/InetDiscoveryInfo.groovy
  112. +10 −10 gretty/src/org/mbte/gretty/remote/inet/MulticastChannel.groovy
  113. +15 −12 gretty/src/org/mbte/gretty/test/GrettyServerTestCase.groovy
  114. +10 −10 gretty/tests/org/mbte/gretty/httpserver/Base64Test.groovy
  115. +10 −10 gretty/tests/org/mbte/gretty/httpserver/ContextTest.groovy
  116. +11 −11 gretty/tests/org/mbte/gretty/httpserver/CookiesTest.groovy
  117. +10 −10 gretty/tests/org/mbte/gretty/httpserver/HttpClientPoolTest.groovy
  118. +10 −10 gretty/tests/org/mbte/gretty/httpserver/JsonTest.groovy
  119. +10 −10 gretty/tests/org/mbte/gretty/httpserver/Performance.groovy
  120. +2 −2 gretty/tests/org/mbte/gretty/httpserver/ProxyTest.groovy
  121. +10 −10 gretty/tests/org/mbte/gretty/httpserver/RedirectTest.groovy
  122. +10 −10 gretty/tests/org/mbte/gretty/httpserver/RestTest.groovy
  123. +10 −10 gretty/tests/org/mbte/gretty/httpserver/ServerTest.groovy
  124. +11 −13 gretty/tests/org/mbte/gretty/httpserver/SessionsTest.groovy
  125. +11 −11 gretty/tests/org/mbte/gretty/httpserver/TemplateTest.groovy
  126. +10 −10 gretty/tests/org/mbte/gretty/httpserver/WebSocketTest.groovy
  127. +10 −10 gretty/tests/org/mbte/gretty/remote/ClusterTest.groovy
  128. +10 −10 gretty/tests/org/mbte/gretty/remote/PublisherTest.groovy
  129. +10 −10 gretty/tests/org/mbte/gretty/remote/RemoteChannelTest.groovy
  130. +17 −1 settings.gradle
View
16 Examples/_._._toImprove/Load10x100k.groovy
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2009-2010 MBTE Sweden AB.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
@Typed package examples
import java.nio.ByteBuffer
View
18 Examples/_._._toImprove/chat/build.gradle
@@ -1,17 +1,17 @@
/*
* Copyright 2009-2010 MBTE Sweden AB.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
apply plugin: 'groovy'
View
18 Examples/_._._toImprove/chat/src/org/mbte/chat/ChatAppModule.groovy
@@ -1,17 +1,17 @@
/*
* Copyright 2009-2010 MBTE Sweden AB.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package org.mbte.chat
View
18 Examples/_._._toImprove/chat/src/org/mbte/chat/ChatApplication.groovy
@@ -1,17 +1,17 @@
/*
* Copyright 2009-2010 MBTE Sweden AB.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package org.mbte.chat
View
18 Examples/_._._toImprove/chat/src/org/mbte/chat/LoginService.groovy
@@ -1,17 +1,17 @@
/*
* Copyright 2009-2010 MBTE Sweden AB.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package org.mbte.chat
View
18 Examples/_._._toImprove/chat/src/org/mbte/chat/model/Conversation.groovy
@@ -1,17 +1,17 @@
/*
* Copyright 2009-2010 MBTE Sweden AB.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package org.mbte.chat.model
View
18 Examples/_._._toImprove/chat/src/org/mbte/chat/model/ConversationDAO.groovy
@@ -1,17 +1,17 @@
/*
* Copyright 2009-2010 MBTE Sweden AB.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
View
18 Examples/_._._toImprove/chat/src/org/mbte/chat/model/MongoDatastore.groovy
@@ -1,17 +1,17 @@
/*
* Copyright 2009-2010 MBTE Sweden AB.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package org.mbte.chat.model
View
20 Examples/_._._toImprove/chat/src/org/mbte/chat/model/User.groovy
@@ -1,17 +1,17 @@
/*
- * Copyright 2009-2011 MBTE Sweden AB.
+ * Copyright 2009-2010 MBTE Sweden AB.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package org.mbte.chat.model
View
18 Examples/_._._toImprove/chat/src/org/mbte/chat/model/UserDAO.groovy
@@ -1,17 +1,17 @@
/*
* Copyright 2009-2010 MBTE Sweden AB.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package org.mbte.chat.model
View
18 Examples/_._._toImprove/chat/tests/org/mbte/chat/ChatAppTest.groovy
@@ -1,17 +1,17 @@
/*
* Copyright 2009-2010 MBTE Sweden AB.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package org.mbte.chat
View
18 Examples/_._._toImprove/chat/tests/org/mbte/chat/ConversationTest.groovy
@@ -1,17 +1,17 @@
/*
* Copyright 2009-2010 MBTE Sweden AB.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
View
18 Examples/_._._toImprove/chat/tests/org/mbte/chat/ServerTest.groovy
@@ -1,17 +1,17 @@
/*
* Copyright 2009-2010 MBTE Sweden AB.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package org.mbte.chat
View
18 Examples/_._._toImprove/chat/tests/org/mbte/chat/UserTest.groovy
@@ -1,17 +1,17 @@
/*
* Copyright 2009-2010 MBTE Sweden AB.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package org.mbte.chat
View
16 Examples/_._._toImprove/groovychat/PureGroovyHttpServer.groovy
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2009-2010 MBTE Sweden AB.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
import org.mbte.gretty.httpserver.GrettyServer
import org.mbte.gretty.JacksonCategory
import org.mbte.gretty.httpserver.GrettyHttpRequest
View
16 Examples/_._._toImprove/groovychat/static/js/application.js
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2009-2010 MBTE Sweden AB.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
// Set URL of your WebSocketMain.swf here:
WEB_SOCKET_SWF_LOCATION = "WebSocketMain.swf";
// Set this to dump debug message from Flash to console.log:
View
16 Examples/_._._toImprove/index.html
@@ -1,3 +1,19 @@
+<!--
+ ~ Copyright 2009-2010 MBTE Sweden AB.
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
<html>
<body>
Hello
View
16 Examples/_._._toImprove/mapserver/HashMapServer.groovy
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2009-2010 MBTE Sweden AB.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
@Typed package mapserver
import org.mbte.gretty.AbstractServer
View
16 Examples/_._._toImprove/webkvstore/GrettyWebKeyStore.groovy
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2009-2010 MBTE Sweden AB.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
@Typed package org.mbte.gretty.examples
import org.mbte.gretty.httpserver.GrettyServer
View
16 Examples/_._._toImprove/webkvstore/static/webkvstore.html
@@ -1,3 +1,19 @@
+<!--
+ ~ Copyright 2009-2010 MBTE Sweden AB.
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
<html>
<head>
<title>WebKVStore test</title>
View
16 Examples/_._._toImprove/websockets/GrettyTest.groovy
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2009-2010 MBTE Sweden AB.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
@Typed package gretty
import org.mbte.gretty.httpserver.GrettyServer
View
16 Examples/_._._toImprove/websockets/lifeFiles/js/life.js
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2009-2010 MBTE Sweden AB.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
var conn
var cells = {}
View
16 Examples/_._._toImprove/websockets/lifeFiles/life.html
@@ -1,3 +1,19 @@
+<!--
+ ~ Copyright 2009-2010 MBTE Sweden AB.
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
View
16 Examples/_._._toImprove/websockets/rootFiles/index.html
@@ -1,3 +1,19 @@
+<!--
+ ~ Copyright 2009-2010 MBTE Sweden AB.
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
View
16 Examples/_._._toImprove/websockets/rootFiles/js/prototype.js
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2009-2010 MBTE Sweden AB.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
/* Prototype JavaScript framework, version 1.6.1
* (c) 2005-2009 Sam Stephenson
*
View
16 Examples/_._._toImprove/websockets/rootFiles/js/pseudows.js
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2009-2010 MBTE Sweden AB.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
(function() {
function initPseudoWebSockets() {
window.WebSocket = Class.create({
View
16 Examples/_._._toImprove/websockets/webSocketsFiles/ws.html
@@ -1,3 +1,19 @@
+<!--
+ ~ Copyright 2009-2010 MBTE Sweden AB.
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
View
20 Examples/echoserver/Echo.groovy
@@ -1,17 +1,17 @@
/*
- * Copyright 2009-2011 MBTE Sweden AB.
+ * Copyright 2009-2010 MBTE Sweden AB.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
@Typed package examples
View
21 Examples/helloworld/GppSimpleHttpServer.groovy
@@ -1,3 +1,21 @@
+/*
+ * Copyright 2009-2010 MBTE Sweden AB.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+
@Typed package examples
import org.mbte.gretty.httpserver.GrettyServer
@@ -6,7 +24,7 @@ import org.mbte.gretty.httpserver.GrettyContext
GrettyServer server = [
localAddress: new InetSocketAddress("localhost", 8080),
- default: {
+ defaultHandler: {
response.redirect "/"
},
@@ -28,3 +46,4 @@ GrettyServer server = [
]
]
server.start ()
+
View
60 Examples/helloworld/GroovySimpleHttpServer.groovy
@@ -1,40 +1,50 @@
/*
* Copyright 2009-2010 MBTE Sweden AB.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package examples
import org.mbte.gretty.httpserver.GrettyServer
-GrettyServer server = []
-server.groovy = [
- localAddress: new InetSocketAddress("localhost", 8080),
-
- dir: "web",
-
- default: {
+def server = new GrettyServer().
+ localAddress(new InetSocketAddress(8080)).
+ dir("web").
+ defaultHandler {
response.redirect "/"
- },
-
- "/": {
+ }.
+ "/" {
get {
- response.html = template("web/templates/main.gpptl") { binding ->
- binding.title = 'Hello, World!'
- binding.message = 'Hello, Dynamic World!'
- }
+ response.html = template("web/templates/main.gpptl", [title:'Hello, World!', message: 'Hello, Dynamic World!'])
}
- }
-]
+ }.
+ webContext("/myapp", "myapp")
+
server.start ()
+
+server.doTest("/nosuchurl") { response ->
+ assert response.status.code == 301
+ assert response.getHeader("Location") == "/"
+}
+
+server.doTest("/") { response ->
+ assert response.status.code == 200
+ def respBody = response.contentText
+ assert respBody.contains("<title>Hello, World!</title>")
+ assert respBody.contains("Hello, Dynamic World!(from template)<br>")
+ assert respBody.contains("<center>HEADER</center>")
+ assert respBody.contains("<center>FOOTER</center>")
+}
+
+server.stop ()
View
78 Examples/helloworld/JavaSimpleHttpServer.java
@@ -1,17 +1,17 @@
/*
- * Copyright 2009-2011 MBTE Sweden AB.
+ * Copyright 2009-2010 MBTE Sweden AB.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
import org.mbte.gretty.httpserver.*;
@@ -22,27 +22,43 @@
public class JavaSimpleHttpServer {
public static void main(String[] args) {
- GrettyServer server = new GrettyServer();
- server.setLocalAddress(new InetSocketAddress("localhost", 8080));
- server.setDir("web");
- server.setDefault(new GrettyHttpHandler() {
- public void handle(Map<String, String> pathArguments) {
- getResponse().redirect("/");
- }
- });
- server.addRestDescription("/", new GrettyRestDescription(){
- public void run() {
- get(new GrettyHttpHandler() {
- public void handle(Map<String, String> pathArguments) {
- Map binding = new HashMap();
- binding.put("title", "Hello, World!");
- binding.put("message", "Hello, Java World");
- getResponse().setHtml(template("web/templates/main.gpptl", binding));
- }
- });
- }
- });
- server.addWebContext("/myapp", new GrettyContext("myapp"));
+ GrettyServer server = new GrettyServer()
+ .localAddress(new InetSocketAddress("localhost", 8080))
+ .dir("web")
+ .defaultHandler(new GrettyHttpHandler() {
+ public void handle(Map<String, String> pathArguments) {
+ getResponse().redirect("/");
+ }
+ })
+ .handler("/", new GrettyRestDescription() {
+ public void run() {
+ get(new GrettyHttpHandler() {
+ public void handle(Map<String, String> pathArguments) {
+ Map binding = new HashMap();
+ binding.put("title", "Hello, World!");
+ binding.put("message", "Hello, Java World");
+ getResponse().setHtml(template("web/templates/main.gpptl", binding));
+ }
+ });
+ }
+ })
+ .webContext("/myapp", new GrettyContext("myapp"));
server.start();
+
+ GrettyHttpResponse response;
+
+ response = server.doTest("/nosuchurl");
+ assert response.getStatus().getCode() == 301;
+ assert response.getHeader("Location").equals("/");
+
+ response = server.doTest("/");
+ assert response.getStatus().getCode() == 200;
+ String respBody = response.getContentText();
+ assert respBody.contains("<title>Hello, World!</title>");
+ assert respBody.contains("Hello, Dynamic World!(from template)<br>");
+ assert respBody.contains("<center>HEADER</center>");
+ assert respBody.contains("<center>FOOTER</center>");
+
+ server.stop();
}
}
View
18 Examples/helloworld/myapp/default.groovy
@@ -1,9 +1,25 @@
+/*
+ * Copyright 2009-2010 MBTE Sweden AB.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
def message = "Hello, world!"
response.html = """\
<html>
<head>
- <title>Index</title>
+ <title>Index Page</title>
</head>
<body>
<h1>${message}</h1>
View
16 Examples/helloworld/web/static/gindex.html
@@ -1,3 +1,19 @@
+<!--
+ ~ Copyright 2009-2010 MBTE Sweden AB.
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
View
16 Examples/helloworld/web/templates/line.gpp
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2009-2010 MBTE Sweden AB.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
Integer index = lineNum
def color = index & 1 ? '#7F0000' : '#007F00'
View
84 build.gradle
@@ -1,31 +1,37 @@
/*
- * Copyright 2009-2011 MBTE Sweden AB.
+ * Copyright 2009-2010 MBTE Sweden AB.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
apply plugin: 'idea'
-def _version = '0.4.265'
+def _version = '0.4.268'
+def _gppVersion = '0.4.268_1.8.0'
-subprojects {
- apply plugin: 'groovy'
+Set groovyProjects = ['gretty', 'gretty-hazelcast']
+
+subprojects { prj ->
+ def groovyProject = groovyProjects.contains(prj.name)
+ def scalaProject = prj.name.contains('-scala')
+
+ apply plugin: groovyProject ? 'groovy' : ( scalaProject ? 'scala' : 'java')
apply plugin: 'idea'
apply plugin: 'maven'
group = 'org.mbte.groovypp'
version = _version
- gppVersion = '0.4.261_1.8.0'
+ gppVersion = _gppVersion
repositories {
mavenCentral ()
@@ -36,22 +42,46 @@ subprojects {
mavenRepo urls: 'http://repository.jboss.org/nexus/content/groups/public/'
}
- sourceSets {
- main {
- groovy {
- srcDir 'src'
+ dependencies {
+ if(groovyProject) {
+ groovy group: 'org.mbte.groovypp', name: 'groovypp', version: "$gppVersion"
+ compile group: 'org.mbte.groovypp', name: 'groovypp', version: "$gppVersion"
}
- resources {
- srcDirs 'src'
+
+ if(scalaProject) {
+ // Libraries needed to run the scala tools
+ scalaTools 'org.scala-lang:scala-compiler:2.8.1'
+ scalaTools 'org.scala-lang:scala-library:2.8.1'
+
+ // Libraries needed for scala api
+ compile 'org.scala-lang:scala-library:2.8.1'
}
+
+ testCompile(group: 'junit', name: 'junit', version: '4.8.1')
+ }
+
+ sourceSets {
+ main {
+ if(groovyProject)
+ groovy { srcDir 'src' }
+ else
+ if(scalaProject)
+ scala { srcDir 'src' }
+ else
+ java { srcDir 'src' }
+ resources { srcDirs 'src' }
}
test {
- groovy {
- srcDir 'tests'
+ if(groovyProject)
+ groovy { srcDir 'tests' }
+ else
+ if(scalaProject)
+ scala { srcDir 'tests' }
+ else
+ java { srcDir 'tests' }
}
}
- }
task sourcesJar(type: Jar, dependsOn:classes) {
classifier = 'sources'
@@ -78,11 +108,15 @@ subprojects {
task deployGoogle(dependsOn:[':gretty:sourcesJar', ':gretty:jar', ':gretty-hazelcast:jar', ':gretty-hazelcast:sourcesJar']) << {
ant.taskdef(name:"gcupload", classname:"net.bluecow.googlecode.ant.GoogleCodeUploadTask", classpath:"lib/ant-googlecode-0.0.2.jar")
- ant.gcupload(username:GOOGLE_USER, password:GOOGLE_PASSWORD, projectname:"groovypptest", filename:file("gretty/build/libs/gretty-${_version}.jar").absolutePath, targetfilename:"gretty-${_version}.jar", summary:"Gretty $_version", labels:"Featured", verbose:"true")
+ ant.gcupload(username:GOOGLE_USER, password:GOOGLE_PASSWORD, projectname:"groovypptest", filename:file("gretty-api/build/libs/gretty-api-${_version}.jar").absolutePath, targetfilename:"gretty-hazelcast-${_version}.jar", summary:"Gretty API module $_version (Use with Groovy++ $_gppVersion)", labels:"Featured", verbose:"true")
+
+ ant.gcupload(username:GOOGLE_USER, password:GOOGLE_PASSWORD, projectname:"groovypptest", filename:file("gretty-api/build/libs/gretty-api-${_version}-sources.jar").absolutePath, targetfilename:"gretty-hazelcast-${_version}-sources.jar", summary:"Gretty API module $_version sources", labels:"Featured", verbose:"true")
+
+ ant.gcupload(username:GOOGLE_USER, password:GOOGLE_PASSWORD, projectname:"groovypptest", filename:file("gretty/build/libs/gretty-${_version}.jar").absolutePath, targetfilename:"gretty-${_version}.jar", summary:"Gretty $_version (Use with Groovy++ $_gppVersion)", labels:"Featured", verbose:"true")
ant.gcupload(username:GOOGLE_USER, password:GOOGLE_PASSWORD, projectname:"groovypptest", filename:file("gretty/build/libs/gretty-${_version}-sources.jar").absolutePath, targetfilename:"gretty-${_version}-sources.jar", summary:"Gretty $_version sources", labels:"Featured", verbose:"true")
- ant.gcupload(username:GOOGLE_USER, password:GOOGLE_PASSWORD, projectname:"groovypptest", filename:file("gretty-hazelcast/build/libs/gretty-hazelcast-${_version}.jar").absolutePath, targetfilename:"gretty-hazelcast-${_version}.jar", summary:"Gretty Hazelcast module $_version", labels:"Featured", verbose:"true")
+ ant.gcupload(username:GOOGLE_USER, password:GOOGLE_PASSWORD, projectname:"groovypptest", filename:file("gretty-hazelcast/build/libs/gretty-hazelcast-${_version}.jar").absolutePath, targetfilename:"gretty-hazelcast-${_version}.jar", summary:"Gretty Hazelcast module $_version (Use with Groovy++ $_gppVersion)", labels:"Featured", verbose:"true")
ant.gcupload(username:GOOGLE_USER, password:GOOGLE_PASSWORD, projectname:"groovypptest", filename:file("gretty-hazelcast/build/libs/gretty-hazelcast-${_version}-sources.jar").absolutePath, targetfilename:"gretty-hazelcast-${_version}-sources.jar", summary:"Gretty Haselcast module $_version sources", labels:"Featured", verbose:"true")
}
View
18 gradle-wrapper.properties
@@ -1,17 +1,17 @@
#
# Copyright 2009-2010 MBTE Sweden AB.
#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
#
-# http://www.apache.org/licenses/LICENSE-2.0
+# http://www.apache.org/licenses/LICENSE-2.0
#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
#
#Thu Dec 02 15:52:58 IST 2010
View
4 gretty-hazelcast/tests/org/mbte/gretty/hazelcast/ClusterTest.groovy
@@ -39,7 +39,7 @@ import org.mbte.gretty.httpclient.HttpRequestHelper
sessionManager: new GrettyHazelcastSessionManager(hazelcast),
- default: {
+ defaultHandler: {
Integer obj = session.counter
println "$i: $obj"
if(obj == null) {
@@ -70,7 +70,7 @@ import org.mbte.gretty.httpclient.HttpRequestHelper
if(sessionId.get())
req.addCookie("JSESSIONID", sessionId.get().toString())
- doTest(req, "test_server_${i%3}") { GrettyHttpResponse response ->
+ doTest(req, new LocalAddress("test_server_${i%3}")) { GrettyHttpResponse response ->
def session = response.getCookie("JSESSIONID")?.value
sessionId.set(session)
println "$i ${response.contentText} $session"
View
2  gretty-hazelcast/tests/org/mbte/gretty/hazelcast/SessionsTest.groovy
@@ -31,7 +31,7 @@ import com.hazelcast.config.MapConfig
server = [
sessionManager: new GrettyHazelcastSessionManager(hazelcast),
- default: {
+ defaultHandler: {
Integer obj = session.counter
if(obj == null) {
session.counter = obj = 1
View
24 gretty-scala/build.gradle
@@ -0,0 +1,24 @@
+/*
+ * Gretty Framework
+ * Copyright (C) 2008-2011 MBTE Sweden AB
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>
+ */
+
+dependsOn ':gretty'
+
+dependencies {
+ compile project(':gretty')
+}
+
View
55 gretty-scala/gretty-scala.iml
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="JAVA_MODULE" version="4">
+ <component name="FacetManager">
+ <facet type="scala" name="Scala">
+ <configuration>
+ <option name="compilerLibraryLevel" value="Global" />
+ <option name="compilerLibraryName" value="scala-compiler-2.8.1" />
+ </configuration>
+ </facet>
+ </component>
+ <component name="NewModuleRootManager" inherit-compiler-output="false">
+ <output url="file://$MODULE_DIR$/build/classes/main" />
+ <output-test url="file://$MODULE_DIR$/build/classes/test" />
+ <exclude-output />
+ <content url="file://$MODULE_DIR$">
+ <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/main/scala" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/main/resources" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/test/scala" isTestSource="true" />
+ <sourceFolder url="file://$MODULE_DIR$/src/test/resources" isTestSource="true" />
+ <sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" />
+ <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
+ <excludeFolder url="file://$MODULE_DIR$/.gradle" />
+ <excludeFolder url="file://$MODULE_DIR$/build" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="library" name="scala-library-2.8.1" level="application" />
+ <orderEntry type="module-library" exported="">
+ <library>
+ <CLASSES>
+ <root url="jar://$USER_HOME$/.gradle/cache/org.scala-lang/scala-library/jars/scala-library-2.8.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES>
+ <root url="jar://$USER_HOME$/.gradle/cache/org.scala-lang/scala-library/sources/scala-library-2.8.1-sources.jar!/" />
+ </SOURCES>
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" scope="TEST">
+ <library>
+ <CLASSES>
+ <root url="jar://$USER_HOME$/.gradle/cache/junit/junit/jars/junit-4.8.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES>
+ <root url="jar://$USER_HOME$/.gradle/cache/junit/junit/sources/junit-4.8.1-sources.jar!/" />
+ </SOURCES>
+ </library>
+ </orderEntry>
+ <orderEntry type="module" module-name="gretty" />
+ </component>
+</module>
+
View
120 gretty-scala/src/org/mbte/gretty/scala/TcpClient.scala
@@ -0,0 +1,120 @@
+/*
+ * Gretty Framework
+ * Copyright (C) 2008-2011 MBTE Sweden AB
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>
+ */
+
+package org.mbte.gretty.scala
+
+import java.net.SocketAddress
+import org.jboss.netty.channel._
+
+class TcpClient {
+// val delegate = Gretty.getInstance.createTcpClient
+//
+// /**
+// * Connect the client to the server
+// * @return
+// */
+// def connect: ChannelFuture = { delegate.connect() }
+//
+// /**
+// * Connect the client to the server
+// */
+// def connect( fn: (ChannelFuture) => Any) {
+// delegate.connect(new ChannelFutureListener {
+// def operationComplete(future: ChannelFuture) {
+// fn(future)
+// }
+// })
+// }
+//
+// /**
+// * @return is the client connected
+// */
+// def isConnected: Boolean = { delegate.isConnected }
+//
+// def remoteAddress(remoteAddress: SocketAddress) : TcpClient = {delegate.remoteAddress(remoteAddress); this }
+//
+// def handler(handler: IChannelHandler) : TcpClient = { delegate.handler(handler); this }
+//
+// def localAddress(localAddress: SocketAddress) : TcpClient = { delegate.localAddress(localAddress); this }
+//
+// def onBuildPipeline(fn: (ChannelPipeline) => Any) = {
+// delegate.onBuildPipeline(new BuildPipelineEventHandler {
+// def onBuildPipeline(pipeline: ChannelPipeline) {
+// fn(pipeline)
+// }
+// })
+// this
+// }
+//
+// def textProtocol(fn: (MessageEvent) => Boolean) = {
+// delegate.onBuildPipeline(new BuildPipelineEventHandler {
+// def onBuildPipeline(pipeline: ChannelPipeline) {
+// BuildPipelineEventHandler.addTextProtocol(pipeline)
+// }
+// })
+// delegate.onMessage(new MessageEventHandler {
+// def onMessage(event: MessageEvent) = fn(event);
+// })
+// this
+// }
+//
+// def onMessage(fn: (MessageEvent) => Boolean) : TcpClient = {
+// delegate.onMessage(new MessageEventHandler {
+// def onMessage(event: MessageEvent): Boolean = {
+// fn(event)
+// }
+// })
+// this
+// }
+//
+// def onException(fn: (Channel,Throwable) => Any) : TcpClient = {
+// delegate.onException(new ExceptionEventHandler {
+// def onException(channel: Channel, throwable: Throwable) {
+// fn(channel, throwable)
+// }
+// })
+// this
+// }
+//
+// def onClose(fn: (Channel) => Any) : TcpClient = {
+// delegate.onClose(new ChannelEventHandler {
+// def onChannelEvent(channel: Channel) {
+// fn(channel)
+// }
+// })
+// this
+// }
+//
+// def onDisconnect(fn: (Channel) => Any) : TcpClient = {
+// delegate.onDisconnect(new ChannelEventHandler {
+// def onChannelEvent(channel: Channel) {
+// fn(channel)
+// }
+// })
+// this
+// }
+//
+// def onConnect(fn: (Channel) => Any) : TcpClient = {
+// delegate.onConnect(new ChannelEventHandler {
+// def onChannelEvent(channel: Channel) {
+// fn(channel)
+// }
+// })
+// this
+// }
+}
View
89 gretty-scala/src/org/mbte/gretty/scala/TcpServer.scala
@@ -0,0 +1,89 @@
+/*
+
+ * Gretty Framework
+ * Copyright (C) 2008-2011 MBTE Sweden AB
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>
+ */
+
+package org.mbte.gretty.scala
+
+import java.net.SocketAddress
+import org.jboss.netty.channel.{ChannelPipeline, MessageEvent, Channel}
+import org.mbte.gretty.httpserver.GrettyServer
+import org.mbte.gretty.AbstractServer
+
+class TcpServer extends AbstractServer {
+
+// val delegate = Gretty.getInstance.createTcpServer
+//
+// def handler(handler: IChannelHandler) = { delegate.handler(handler); this }
+//
+// def localAddress(localAddress: SocketAddress) = { delegate.localAddress(localAddress); this }
+//
+// def onBuildPipeline(fn: (ChannelPipeline) => Any) : TcpServer = {
+// delegate.onBuildPipeline(new BuildPipelineEventHandler {
+// def onBuildPipeline(pipeline: ChannelPipeline) {
+// fn(pipeline)
+// }
+// })
+// this
+// }
+//
+// def onMessage(fn: (MessageEvent) => Boolean) : TcpServer = {
+// delegate.onMessage(new MessageEventHandler {
+// def onMessage(event: MessageEvent): Boolean = {
+// fn(event)
+// }
+// })
+// this
+// }
+//
+// def onException(fn: (Channel,Throwable) => Any) : TcpServer = {
+// delegate.onException(new ExceptionEventHandler {
+// def onException(channel: Channel, throwable: Throwable) {
+// fn(channel, throwable)
+// }
+// })
+// this
+// }
+//
+// def onClose(fn: (Channel) => Any) : TcpServer = {
+// delegate.onClose(new ChannelEventHandler {
+// def onChannelEvent(channel: Channel) {
+// fn(channel)
+// }
+// })
+// this
+// }
+//
+// def onDisconnect(fn: (Channel) => Any) : TcpServer = {
+// delegate.onDisconnect(new ChannelEventHandler {
+// def onChannelEvent(channel: Channel) {
+// fn(channel)
+// }
+// })
+// this
+// }
+//
+// def onConnect(fn: (Channel) => Any) : TcpServer = {
+// delegate.onConnect(new ChannelEventHandler {
+// def onChannelEvent(channel: Channel) {
+// fn(channel)
+// }
+// })
+// this
+// }
+//
+}
View
80 gretty-scala/tests/org/mbte/gretty/GrettyScalaTest.scala
@@ -0,0 +1,80 @@
+/*
+ * Gretty Framework
+ * Copyright (C) 2008-2011 MBTE Sweden AB
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>
+ */
+
+package org.mbte.gretty
+
+import _root_.scala.Predef
+import junit.framework.TestCase
+import org.jboss.netty.handler.codec.string.{StringEncoder, StringDecoder}
+import java.util.concurrent.CountDownLatch
+import org.jboss.netty.channel.local.LocalAddress
+import org.jboss.netty.channel._
+import scala.{TcpClient, TcpServer}
+
+class GrettyScalaTest extends TestCase {
+
+// val server = new TcpServer().
+// localAddress(new LocalAddress("test_server")).
+// onMessage{ event =>
+// val message: String = event.getMessage.asInstanceOf[String]
+// System.out.println(message)
+// event.getChannel.write(message)
+// false
+// }.
+// onConnect{ channel =>
+// System.out.println("connected " + channel.toString)
+// }.
+// onDisconnect{ channel =>
+// System.out.println("disconnected " + channel.toString)
+// }.
+// onBuildPipeline { pipeline =>
+// pipeline.addBefore("this", "string.decoder", new StringDecoder)
+// pipeline.addBefore("this", "string.encoder", new StringEncoder)
+// }
+//
+// override def setUp() = server.start()
+//
+// override def tearDown() = server.stop()
+//
+// def testMe () {
+// val countDownLatch = new CountDownLatch(1)
+//
+// val client = new TcpClient().
+// remoteAddress(new LocalAddress("test_server")).
+// textProtocol{ event =>
+// val message: String = event.getMessage.asInstanceOf[String]
+// Predef.assert("Hello, World!" == message)
+// countDownLatch.countDown
+// false
+// }.
+// onConnect{ channel =>
+// System.out.println("client connected " + channel.toString)
+// }.
+// onDisconnect{ channel =>
+// System.out.println("client disconnected " + channel.toString)
+// }
+//
+// client.connect.addListener(new ChannelFutureListener {
+// def operationComplete(future: ChannelFuture): Unit = {
+// future.getChannel.write("Hello, World!\n")
+// }
+// })
+//
+// countDownLatch.await
+// }
+}
View
209 gretty.ipr
@@ -0,0 +1,209 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="AntConfiguration">
+ <defaultAnt bundledAnt="true" />
+ </component>
+ <component name="CompilerConfiguration">
+ <option name="DEFAULT_COMPILER" value="Javac" />
+ <resourceExtensions>
+ <entry name=".+\.(properties|xml|html|dtd|tld)" />
+ <entry name=".+\.(gif|png|jpeg|jpg)" />
+ </resourceExtensions>
+ <wildcardResourcePatterns>
+ <entry name="?*.properties" />
+ <entry name="?*.xml" />
+ <entry name="?*.gif" />
+ <entry name="?*.png" />
+ <entry name="?*.jpeg" />
+ <entry name="?*.jpg" />
+ <entry name="?*.html" />
+ <entry name="?*.dtd" />
+ <entry name="?*.tld" />
+ <entry name="?*.ftl" />
+ </wildcardResourcePatterns>
+ <annotationProcessing enabled="false" useClasspath="true" />
+ </component>
+ <component name="CopyrightManager" default="MBTE Gretty AGPL">
+ <copyright>
+ <option name="notice" value="Copyright 2009-2010 MBTE Sweden AB.&#10;&#10; Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);&#10; you may not use this file except in compliance with the License.&#10; You may obtain a copy of the License at&#10;&#10; http://www.apache.org/licenses/LICENSE-2.0&#10;&#10; Unless required by applicable law or agreed to in writing, software&#10; distributed under the License is distributed on an &quot;AS IS&quot; BASIS,&#10; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&#10; See the License for the specific language governing permissions and&#10; limitations under the License." />
+ <option name="keyword" value="Copyright" />
+ <option name="allowReplaceKeyword" value="" />
+ <option name="myName" value="MBTE Gretty AGPL" />
+ <option name="myLocal" value="true" />
+ </copyright>
+ <module2copyright />
+ </component>
+ <component name="DependencyValidationManager">
+ <option name="SKIP_IMPORT_STATEMENTS" value="false" />
+ </component>
+ <component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
+ <component name="EntryPointsManager">
+ <entry_points version="2.0" />
+ </component>
+ <component name="HighlightingAdvisor">
+ <option name="SUGGEST_TYPE_AWARE_HIGHLIGHTING" value="false" />
+ <option name="TYPE_AWARE_HIGHLIGHTING_ENABLED" value="true" />
+ </component>
+ <component name="IdProvider" IDEtalkID="B80211FAD068C7B55641ED0780369ACD" />
+ <component name="JavadocGenerationManager">
+ <option name="OUTPUT_DIRECTORY" />
+ <option name="OPTION_SCOPE" value="protected" />
+ <option name="OPTION_HIERARCHY" value="true" />
+ <option name="OPTION_NAVIGATOR" value="true" />
+ <option name="OPTION_INDEX" value="true" />
+ <option name="OPTION_SEPARATE_INDEX" value="true" />
+ <option name="OPTION_DOCUMENT_TAG_USE" value="false" />
+ <option name="OPTION_DOCUMENT_TAG_AUTHOR" value="false" />
+ <option name="OPTION_DOCUMENT_TAG_VERSION" value="false" />
+ <option name="OPTION_DOCUMENT_TAG_DEPRECATED" value="true" />
+ <option name="OPTION_DEPRECATED_LIST" value="true" />
+ <option name="OTHER_OPTIONS" value="" />
+ <option name="HEAP_SIZE" />
+ <option name="LOCALE" />
+ <option name="OPEN_IN_BROWSER" value="true" />
+ </component>
+ <component name="Palette2">
+ <group name="Swing">
+ <item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
+ <default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
+ </item>
+ <item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
+ <default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
+ </item>
+ <item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
+ <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
+ </item>
+ <item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
+ <default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
+ </item>
+ <item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
+ <default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
+ <initial-values>
+ <property name="text" value="Button" />
+ </initial-values>
+ </item>
+ <item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
+ <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
+ <initial-values>
+ <property name="text" value="RadioButton" />
+ </initial-values>
+ </item>
+ <item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
+ <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
+ <initial-values>
+ <property name="text" value="CheckBox" />
+ </initial-values>
+ </item>
+ <item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
+ <default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
+ <initial-values>
+ <property name="text" value="Label" />
+ </initial-values>
+ </item>
+ <item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
+ <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
+ <preferred-size width="150" height="-1" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
+ <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
+ <preferred-size width="150" height="-1" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
+ <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
+ <preferred-size width="150" height="-1" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
+ <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+ <preferred-size width="150" height="50" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
+ <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+ <preferred-size width="150" height="50" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
+ <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+ <preferred-size width="150" height="50" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
+ <default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
+ </item>
+ <item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
+ <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+ <preferred-size width="150" height="50" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
+ <default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
+ <preferred-size width="150" height="50" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
+ <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+ <preferred-size width="150" height="50" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
+ <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
+ <preferred-size width="200" height="200" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
+ <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
+ <preferred-size width="200" height="200" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
+ <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
+ </item>
+ <item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
+ <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
+ </item>
+ <item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
+ <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
+ </item>
+ <item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
+ <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
+ </item>
+ <item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
+ <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
+ <preferred-size width="-1" height="20" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
+ <default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
+ </item>
+ <item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
+ <default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
+ </item>
+ </group>
+ </component>
+ <component name="ProjectInspectionProfilesVisibleTreeState">
+ <entry key="Project Default">
+ <profile-state />
+ </entry>
+ </component>
+ <component name="ProjectModuleManager">
+ <modules>
+ <module fileurl="file://$PROJECT_DIR$/Examples/Examples.iml" filepath="$PROJECT_DIR$/Examples/Examples.iml" />
+ <module fileurl="file://$PROJECT_DIR$/gretty/gretty.iml" filepath="$PROJECT_DIR$/gretty/gretty.iml" />
+ <module fileurl="file://$PROJECT_DIR$/gretty-hazelcast/gretty-hazelcast.iml" filepath="$PROJECT_DIR$/gretty-hazelcast/gretty-hazelcast.iml" />
+ <module fileurl="file://$PROJECT_DIR$/gretty-scala/gretty-scala.iml" filepath="$PROJECT_DIR$/gretty-scala/gretty-scala.iml" />
+ </modules>
+ </component>
+ <component name="ProjectResources">
+ <default-html-doctype>http://www.w3.org/1999/xhtml</default-html-doctype>
+ </component>
+ <component name="ProjectRootManager" version="2" languageLevel="JDK_1_5" assert-keyword="true" jdk-15="true" project-jdk-name="1.6" project-jdk-type="JavaSDK">
+ <output url="file://$PROJECT_DIR$/out" />
+ </component>
+ <component name="VcsDirectoryMappings">
+ <mapping directory="" vcs="Git" />
+ </component>
+</project>
+
View
20 gretty/build.gradle
@@ -1,17 +1,17 @@
/*
- * Copyright 2009-2011 MBTE Sweden AB.
+ * Copyright 2009-2010 MBTE Sweden AB.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
View
48 gretty/gretty.iml
@@ -4,15 +4,22 @@
<output url="file://$MODULE_DIR$/build/classes/main" />
<output-test url="file://$MODULE_DIR$/build/classes/test" />
<exclude-output />
- <content url="file://$MODULE_DIR$/..">
+ <content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/main/resources" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/main/groovy" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" />
+ <sourceFolder url="file://$MODULE_DIR$/src/test/groovy" isTestSource="true" />
+ <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
+ <sourceFolder url="file://$MODULE_DIR$/src/test/resources" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/../.gradle" />
<excludeFolder url="file://$MODULE_DIR$/../.idea" />
<excludeFolder url="file://$MODULE_DIR$/../Examples" />
<excludeFolder url="file://$MODULE_DIR$/../build" />
<excludeFolder url="file://$MODULE_DIR$/../gretty-hazelcast" />
<excludeFolder url="file://$MODULE_DIR$/../gretty-redis" />
+ <excludeFolder url="file://$MODULE_DIR$/.gradle" />
<excludeFolder url="file://$MODULE_DIR$/build" />
<excludeFolder url="file://$MODULE_DIR$/../gridgain" />
<excludeFolder url="file://$MODULE_DIR$/../out" />
@@ -22,11 +29,22 @@
<orderEntry type="module-library" exported="">
<library>
<CLASSES>
- <root url="jar://$USER_HOME$/.gradle/cache/org.mbte.groovypp/groovypp/jars/groovypp-0.4.261_1.8.0.jar!/" />
+ <root url="jar://$USER_HOME$/.gradle/cache/org.mbte.groovypp/groovypp/jars/groovypp-0.4.268_1.8.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
- <root url="jar://$USER_HOME$/.gradle/cache/org.mbte.groovypp/groovypp/sources/groovypp-0.4.261_1.8.0-sources.jar!/" />
+ <root url="jar://$USER_HOME$/.gradle/cache/org.mbte.groovypp/groovypp/sources/groovypp-0.4.268_1.8.0-sources.jar!/" />
+ </SOURCES>
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library>
+ <CLASSES>
+ <root url="jar://$USER_HOME$/.gradle/cache/junit/junit/jars/junit-4.8.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES>
+ <root url="jar://$USER_HOME$/.gradle/cache/junit/junit/sources/junit-4.8.1-sources.jar!/" />
</SOURCES>
</library>
</orderEntry>
@@ -98,17 +116,6 @@
<orderEntry type="module-library" exported="">
<library>
<CLASSES>
- <root url="jar://$USER_HOME$/.gradle/cache/junit/junit/jars/junit-4.8.1.jar!/" />
- </CLASSES>
- <JAVADOC />
- <SOURCES>
- <root url="jar://$USER_HOME$/.gradle/cache/junit/junit/sources/junit-4.8.1-sources.jar!/" />
- </SOURCES>
- </library>
- </orderEntry>
- <orderEntry type="module-library" exported="">
- <library>
- <CLASSES>
<root url="jar://$USER_HOME$/.gradle/cache/org.jboss.netty/netty/bundles/netty-3.2.4.Final.jar!/" />
</CLASSES>
<JAVADOC />
@@ -139,7 +146,7 @@
</SOURCES>
</library>
</orderEntry>
- <orderEntry type="module-library" exported="" scope="RUNTIME">
+ <orderEntry type="module-library" scope="TEST">
<library>
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/cache/commons-cli/commons-cli/jars/commons-cli-1.1.jar!/" />
@@ -150,17 +157,6 @@
</SOURCES>
</library>
</orderEntry>
- <orderEntry type="module-library" scope="TEST">
- <library>
- <CLASSES>
- <root url="jar://$USER_HOME$/.gradle/cache/junit/junit/jars/junit-4.8.1.jar!/" />
- </CLASSES>
- <JAVADOC />
- <SOURCES>
- <root url="jar://$USER_HOME$/.gradle/cache/junit/junit/sources/junit-4.8.1-sources.jar!/" />
- </SOURCES>
- </library>
- </orderEntry>
</component>
</module>
View
1,186 gretty/src/META-INF/socket.io/FABridge.js
@@ -1,585 +1,601 @@
-/*
- * The Bridge class, responsible for navigating AS instances
- */
-function FABridge(target,bridgeName)
-{
- this.target = target;
- this.remoteTypeCache = {};
- this.remoteInstanceCache = {};
- this.remoteFunctionCache = {};
- this.localFunctionCache = {};
- this.bridgeID = FABridge.nextBridgeID++;
- this.name = bridgeName;
- this.nextLocalFuncID = 0;
- FABridge.instances[this.name] = this;
- FABridge.idMap[this.bridgeID] = this;
-
- return this;
-}
-
-// type codes for packed values
-FABridge.TYPE_ASINSTANCE = 1;
-FABridge.TYPE_ASFUNCTION = 2;
-
-FABridge.TYPE_JSFUNCTION = 3;
-FABridge.TYPE_ANONYMOUS = 4;
-
-FABridge.initCallbacks = {};
-FABridge.userTypes = {};
-
-FABridge.addToUserTypes = function()
-{
- for (var i = 0; i < arguments.length; i++)
- {
- FABridge.userTypes[arguments[i]] = {
- 'typeName': arguments[i],
- 'enriched': false
- };
- }
-}
-
-FABridge.argsToArray = function(args)
-{
- var result = [];
- for (var i = 0; i < args.length; i++)
- {
- result[i] = args[i];
- }
- return result;
-}
-
-function instanceFactory(objID)
-{
- this.fb_instance_id = objID;
- return this;
-}
-
-function FABridge__invokeJSFunction(args)
-{
- var funcID = args[0];
- var throughArgs = args.concat();//FABridge.argsToArray(arguments);
- throughArgs.shift();
-
- var bridge = FABridge.extractBridgeFromID(funcID);
- return bridge.invokeLocalFunction(funcID, throughArgs);
-}
-
-FABridge.addInitializationCallback = function(bridgeName, callback)
-{
- var inst = FABridge.instances[bridgeName];
- if (inst != undefined)
- {
- callback.call(inst);
- return;
- }
-
- var callbackList = FABridge.initCallbacks[bridgeName];
- if(callbackList == null)
- {
- FABridge.initCallbacks[bridgeName] = callbackList = [];
- }
-
- callbackList.push(callback);
-}
-
-// updated for changes to SWFObject2
-function FABridge__bridgeInitialized(bridgeName) {
- var objects = document.getElementsByTagName("object");
- var ol = objects.length;
- var activeObjects = [];
- if (ol > 0) {
- for (var i = 0; i < ol; i++) {
- if (typeof objects[i].SetVariable != "undefined") {
- activeObjects[activeObjects.length] = objects[i];
- }
- }
- }
- var embeds = document.getElementsByTagName("embed");