Permalink
Browse files

Split machine from other modules

  • Loading branch information...
1 parent 6a9f1b0 commit d2ee7e05f75ef30c54de35e24488b63df7d2daac @d6y d6y committed May 27, 2012
Showing with 0 additions and 20,970 deletions.
  1. +0 −163 amqp/src/main/scala/net/liftweb/amqp/AMQPDispatcher.scala
  2. +0 −137 amqp/src/main/scala/net/liftweb/amqp/AMQPSender.scala
  3. +0 −69 facebook/src/main/scala/net/liftweb/ext_api/facebook/Facebook.scala
  4. +0 −70 facebook/src/main/scala/net/liftweb/ext_api/facebook/FacebookConnect.scala
  5. +0 −399 facebook/src/main/scala/net/liftweb/ext_api/facebook/FacebookRestApi.scala
  6. +0 −130 imaging/src/main/scala/net/liftweb/imaging/ImageHelpers.scala
  7. +0 −248 imaging/src/main/scala/net/liftweb/imaging/ImageResizer.scala
  8. +0 −41 imaging/src/test/scala/net/liftweb/imaging/ImageResizerSpec.scala
  9. +0 −76 jta/README.textile
  10. +0 −56 jta/src/main/resources/jta.properties
  11. +0 −16 jta/src/main/resources/persistence.xml
  12. +0 −64 jta/src/main/scala/net/liftweb/transaction/EntityManagerSynchronization.scala
  13. +0 −234 jta/src/main/scala/net/liftweb/transaction/TransactionContext.scala
  14. +0 −239 jta/src/main/scala/net/liftweb/transaction/TransactionService.scala
  15. +0 −57 jta/src/main/scala/net/liftweb/transaction/atomikos/AtomikosTransactionService.scala
  16. +0 −36 jta/src/main/scala/net/liftweb/transaction/hibernate/LiftTransactionManagerLookup.scala
  17. +0 −61 jta/src/test/scala/TransactionMonadSpec.scala
  18. +0 −15 liftsh
  19. +0 −14 liftsh.cmd
  20. +0 −373 machine/src/main/scala/net/liftweb/machine/ProtoStateMachine.scala
  21. +0 −44 machine/src/test/scala/bootstrap/liftweb/Boot.scala
  22. 0 oauth-mapper/src/main/scala/net/liftweb/oauth/.keep
  23. +0 −157 oauth-mapper/src/main/scala/net/liftweb/oauth/mapper/OAuthConsumer.scala
  24. +0 −78 oauth-mapper/src/main/scala/net/liftweb/oauth/mapper/OAuthNonce.scala
  25. +0 −112 oauth-mapper/src/main/scala/net/liftweb/oauth/mapper/OAuthToken.scala
  26. +0 −189 oauth/src/main/scala/net/liftweb/oauth/OAuth.scala
  27. +0 −64 oauth/src/main/scala/net/liftweb/oauth/OAuthAccessor.scala
  28. +0 −81 oauth/src/main/scala/net/liftweb/oauth/OAuthMessage.scala
  29. +0 −35 oauth/src/main/scala/net/liftweb/oauth/OAuthProblemException.scala
  30. +0 −154 oauth/src/main/scala/net/liftweb/oauth/OAuthSignatureMethod.scala
  31. +0 −105 oauth/src/main/scala/net/liftweb/oauth/OAuthTraits.scala
  32. +0 −121 oauth/src/main/scala/net/liftweb/oauth/OAuthValidator.scala
  33. +0 −77 oauth/src/test/scala/net/liftweb/oauth/OAuthSignatureMethodSpec.scala
  34. +0 −248 openid/src/main/scala/net/liftweb/openid/Extensions.scala
  35. +0 −316 openid/src/main/scala/net/liftweb/openid/OpenID.scala
  36. +0 −263 openid/src/main/scala/net/liftweb/openid/OpenIDProtoUser.scala
  37. +0 −36 openid/src/test/scala/net/liftweb/openid/RawHelperSpec.scala
  38. +0 −16 osgi/src/main/scala/net/liftweb/osgi/OsgiBootable.scala
  39. +0 −187 osgi/src/main/scala/net/liftweb/osgi/internal/Activator.scala
  40. BIN paypal/src/main/resources/toserve/paypal/en_buynow_107x26.gif
  41. BIN paypal/src/main/resources/toserve/paypal/en_buynow_68x23.gif
  42. BIN paypal/src/main/resources/toserve/paypal/en_buynow_cards_122x47.gif
  43. BIN paypal/src/main/resources/toserve/paypal/en_paynow_107x26.gif
  44. BIN paypal/src/main/resources/toserve/paypal/en_paynow_cards_144x47.gif
  45. +0 −565 paypal/src/main/scala/net/liftweb/paypal/Paypal.scala
  46. +0 −45 paypal/src/main/scala/net/liftweb/paypal/Rules.scala
  47. +0 −47 paypal/src/main/scala/net/liftweb/paypal/snippet/BuyNow.scala
  48. +0 −47 paypal/src/test/scala/net/liftweb/paypal/PaypalIPNSpec.scala
  49. +0 −7 project/build.properties
  50. +0 −93 project/build/LiftModulesProject.scala
  51. +0 −10 project/plugins/Plugins.scala
  52. BIN project/sbt-launch-0.7.7.jar
  53. +0 −141 scalate/src/main/scala/net/liftweb/scalate/LiftTemplateEngine.scala
  54. +0 −100 scalate/src/main/scala/net/liftweb/scalate/ScalateView.scala
  55. +0 −1,380 textile/src/main/scala/net/liftweb/textile/TextileParser.scala
  56. +0 −523 textile/src/test/scala/net/liftweb/textile/TextileSpec.scala
  57. 0 widgets/src/main/resources/net/liftweb/widgets/.keep
  58. BIN widgets/src/main/resources/toserve/autocomplete/indicator.gif
  59. +0 −49 widgets/src/main/resources/toserve/autocomplete/jquery.autocomplete.css
  60. +0 −759 widgets/src/main/resources/toserve/autocomplete/jquery.autocomplete.js
  61. +0 −162 widgets/src/main/resources/toserve/calendars/dayview/style.css
  62. +0 −194 widgets/src/main/resources/toserve/calendars/js/calendarviews.js
  63. +0 −110 widgets/src/main/resources/toserve/calendars/monthview/style.css
  64. +0 −166 widgets/src/main/resources/toserve/calendars/weekview/style.css
  65. +0 −100 widgets/src/main/resources/toserve/common/jquery.bgiframe.js
  66. +0 −119 widgets/src/main/resources/toserve/common/jquery.dimensions.js
  67. +0 −266 widgets/src/main/resources/toserve/common/jquery.tooltip.js
  68. +0 −1,427 widgets/src/main/resources/toserve/flot/excanvas.js
  69. +0 −20 widgets/src/main/resources/toserve/flot/jquery.flot.css
  70. +0 −2,599 widgets/src/main/resources/toserve/flot/jquery.flot.js
  71. +0 −336 widgets/src/main/resources/toserve/flot/jquery.flot.navigate.js
  72. +0 −33 widgets/src/main/resources/toserve/logchanger/logchanger.css
  73. BIN widgets/src/main/resources/toserve/menu/images/arrows-ffffff.png
  74. BIN widgets/src/main/resources/toserve/menu/images/shadow.png
  75. +0 −100 widgets/src/main/resources/toserve/menu/jquery.bgiframe.js
  76. +0 −111 widgets/src/main/resources/toserve/menu/jquery.hoverIntent.js
  77. +0 −93 widgets/src/main/resources/toserve/menu/superfish-navbar.css
  78. +0 −23 widgets/src/main/resources/toserve/menu/superfish-vertical.css
  79. +0 −136 widgets/src/main/resources/toserve/menu/superfish.css
  80. +0 −121 widgets/src/main/resources/toserve/menu/superfish.js
  81. +0 −90 widgets/src/main/resources/toserve/menu/supersubs.js
  82. +0 −125 widgets/src/main/resources/toserve/sparklines/sparklines.min.js
  83. BIN widgets/src/main/resources/toserve/tablesorter/addons/pager/icons/first.png
  84. BIN widgets/src/main/resources/toserve/tablesorter/addons/pager/icons/last.png
  85. BIN widgets/src/main/resources/toserve/tablesorter/addons/pager/icons/next.png
  86. BIN widgets/src/main/resources/toserve/tablesorter/addons/pager/icons/prev.png
  87. +0 −25 widgets/src/main/resources/toserve/tablesorter/addons/pager/jquery.tablesorter.pager.css
  88. +0 −184 widgets/src/main/resources/toserve/tablesorter/addons/pager/jquery.tablesorter.pager.js
  89. +0 −852 widgets/src/main/resources/toserve/tablesorter/jquery.tablesorter.js
  90. BIN widgets/src/main/resources/toserve/tablesorter/themes/blue/asc.gif
  91. BIN widgets/src/main/resources/toserve/tablesorter/themes/blue/bg.gif
  92. BIN widgets/src/main/resources/toserve/tablesorter/themes/blue/desc.gif
  93. +0 −39 widgets/src/main/resources/toserve/tablesorter/themes/blue/style.css
  94. BIN widgets/src/main/resources/toserve/tablesorter/themes/green/asc.png
  95. BIN widgets/src/main/resources/toserve/tablesorter/themes/green/bg.png
  96. BIN widgets/src/main/resources/toserve/tablesorter/themes/green/desc.png
  97. +0 −39 widgets/src/main/resources/toserve/tablesorter/themes/green/style.css
  98. BIN widgets/src/main/resources/toserve/tree/images/file.gif
  99. BIN widgets/src/main/resources/toserve/tree/images/folder-closed.gif
  100. BIN widgets/src/main/resources/toserve/tree/images/folder.gif
  101. BIN widgets/src/main/resources/toserve/tree/images/minus.gif
  102. BIN widgets/src/main/resources/toserve/tree/images/plus.gif
  103. BIN widgets/src/main/resources/toserve/tree/images/spinner.gif
  104. BIN widgets/src/main/resources/toserve/tree/images/treeview-black-line.gif
  105. BIN widgets/src/main/resources/toserve/tree/images/treeview-black.gif
  106. BIN widgets/src/main/resources/toserve/tree/images/treeview-default-line.gif
  107. BIN widgets/src/main/resources/toserve/tree/images/treeview-default.gif
  108. BIN widgets/src/main/resources/toserve/tree/images/treeview-famfamfam-line.gif
  109. BIN widgets/src/main/resources/toserve/tree/images/treeview-famfamfam.gif
  110. BIN widgets/src/main/resources/toserve/tree/images/treeview-gray-line.gif
  111. BIN widgets/src/main/resources/toserve/tree/images/treeview-gray.gif
  112. BIN widgets/src/main/resources/toserve/tree/images/treeview-red-line.gif
  113. BIN widgets/src/main/resources/toserve/tree/images/treeview-red.gif
  114. +0 −82 widgets/src/main/resources/toserve/tree/jquery.treeview.async.js
  115. +0 −136 widgets/src/main/resources/toserve/tree/jquery.treeview.css
  116. +0 −251 widgets/src/main/resources/toserve/tree/jquery.treeview.js
  117. +0 −100 widgets/src/main/resources/toserve/uploadprogress/uploadprogress.js
  118. +0 −219 widgets/src/main/scala/net/liftweb/widgets/autocomplete/AutoComplete.scala
  119. +0 −135 widgets/src/main/scala/net/liftweb/widgets/calendars/CalendarDayView.scala
  120. +0 −68 widgets/src/main/scala/net/liftweb/widgets/calendars/CalendarItem.scala
  121. +0 −234 widgets/src/main/scala/net/liftweb/widgets/calendars/CalendarMonthView.scala
  122. +0 −81 widgets/src/main/scala/net/liftweb/widgets/calendars/CalendarUtils.scala
  123. +0 −172 widgets/src/main/scala/net/liftweb/widgets/calendars/CalendarWeekView.scala
  124. +0 −40 widgets/src/main/scala/net/liftweb/widgets/calendars/ViewMeta.scala
  125. +0 −261 widgets/src/main/scala/net/liftweb/widgets/flot/Flot.scala
  126. +0 −91 widgets/src/main/scala/net/liftweb/widgets/flot/FlotAjax.scala
  127. +0 −37 widgets/src/main/scala/net/liftweb/widgets/flot/FlotCapability.scala
  128. +0 −221 widgets/src/main/scala/net/liftweb/widgets/flot/FlotOptions.scala
  129. +0 −109 widgets/src/main/scala/net/liftweb/widgets/flot/FlotOverview.scala
  130. +0 −41 widgets/src/main/scala/net/liftweb/widgets/flot/FlotSerie.scala
  131. +0 −27 widgets/src/main/scala/net/liftweb/widgets/flot/FlotUtils.scala
  132. +0 −86 widgets/src/main/scala/net/liftweb/widgets/gravatar/Gravatar.scala
  133. +0 −261 widgets/src/main/scala/net/liftweb/widgets/logchanger/LogLevelChanger.scala
  134. +0 −131 widgets/src/main/scala/net/liftweb/widgets/menu/MenuWidget.scala
  135. +0 −68 widgets/src/main/scala/net/liftweb/widgets/rssfeed/RSSfeed.scala
  136. +0 −29 widgets/src/main/scala/net/liftweb/widgets/sparklines/SparklineStyle.scala
  137. +0 −101 widgets/src/main/scala/net/liftweb/widgets/sparklines/Sparklines.scala
  138. +0 −159 widgets/src/main/scala/net/liftweb/widgets/tablesorter/TableSorter.scala
  139. +0 −175 widgets/src/main/scala/net/liftweb/widgets/tree/TreeView.scala
  140. +0 −144 widgets/src/main/scala/net/liftweb/widgets/uploadprogress/UploadProgress.scala
  141. +0 −84 widgets/src/test/scala/bootstrap/liftweb/Boot.scala
  142. +0 −59 widgets/src/test/scala/webapptest/snippet/AutoCompleteDemo.scala
  143. +0 −147 widgets/src/test/scala/webapptest/snippet/CalendarDayViewDemo.scala
  144. +0 −89 widgets/src/test/scala/webapptest/snippet/CalendarMonthViewDemo.scala
  145. +0 −147 widgets/src/test/scala/webapptest/snippet/CalendarWeekViewDemo.scala
  146. +0 −33 widgets/src/test/scala/webapptest/snippet/GravatarDemo.scala
  147. +0 −31 widgets/src/test/scala/webapptest/snippet/MenuSnippet.scala
  148. +0 −34 widgets/src/test/scala/webapptest/snippet/RSSFeedDemo.scala
  149. +0 −49 widgets/src/test/scala/webapptest/snippet/SparklinesDemo.scala
  150. +0 −48 widgets/src/test/scala/webapptest/snippet/TableSorterDemo.scala
  151. +0 −86 widgets/src/test/scala/webapptest/snippet/TreeViewDemo.scala
  152. +0 −59 widgets/src/test/scala/webapptest/snippet/UploadProgressDemo.scala
  153. +0 −21 widgets/src/test/webapp/WEB-INF/web.xml
  154. +0 −3 widgets/src/test/webapp/anothermenu1.html
  155. +0 −3 widgets/src/test/webapp/anothermenu2.html
  156. +0 −10 widgets/src/test/webapp/autocomplete.html
  157. +0 −8 widgets/src/test/webapp/calday.html
  158. +0 −9 widgets/src/test/webapp/calmonth.html
  159. +0 −7 widgets/src/test/webapp/calweek.html
  160. +0 −4 widgets/src/test/webapp/gravatar.html
  161. +0 −137 widgets/src/test/webapp/index.html
  162. +0 −4 widgets/src/test/webapp/rssfeed.html
  163. +0 −6 widgets/src/test/webapp/sparklines.html
  164. +0 −61 widgets/src/test/webapp/style/style.css
  165. +0 −3 widgets/src/test/webapp/submenu1.html
  166. +0 −3 widgets/src/test/webapp/submenu2.html
  167. +0 −3 widgets/src/test/webapp/submenu3.html
  168. +0 −18 widgets/src/test/webapp/templates-hidden/default.html
  169. +0 −9 widgets/src/test/webapp/tree.html
  170. +0 −54 widgets/src/test/webapp/uploadprogress.html
  171. +0 −265 xmpp/src/main/scala/net/liftweb/xmpp/XMPPDispatcher.scala
@@ -1,163 +0,0 @@
-/*
- * Copyright 2007-2010 WorldWide Conferencing, LLC
- *
- * 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.
- */
-
-package net.liftweb {
-package amqp {
-
-import _root_.com.rabbitmq.client._
-import _root_.net.liftweb.actor._
-import _root_.java.io.ObjectInputStream
-import _root_.java.io.ByteArrayInputStream
-import _root_.java.util.Timer
-import _root_.java.util.TimerTask
-
-/**
- * @param a The actor to add as a Listener to this Dispatcher.
- */
-case class AMQPAddListener(a: LiftActor)
-
-/**
- * @param message A deserialized value received via AMQP.
- *
- * Messages received from AMQP are wrapped in this case class. When you
- * register a listener, this is the case class that you will be matching on.
- */
-case class AMQPMessage[T](message: T)
-
-
-/**
- * Reconnect to the AMQP Server after a delay of {@code delay} milliseconds.
- */
-case class AMQPReconnect(delay: Long)
-
-/**
- * An actor that serves as an endpoint for AMQP messages of serialized type T
- * coming into a specific queue/exchange.
- *
- * To listen for messages coming into that queue/exchange, send
- * this actor an AMQPAddListener message.
- *
- * For each message containing a value of type T, all listeners will be send
- * an AMQPMessage contaning that value.
- *
- * See also Enterprise Integration Patterns pp. 508-514
- *
- * @author Steve Jenson (stevej@pobox.com)
- */
-abstract class AMQPDispatcher[T](cf: ConnectionFactory, host: String, port: Int) extends LiftActor {
- var (conn, channel) = connect()
- private var as: List[LiftActor] = Nil
-
- private def connect(): (Connection, Channel) = {
- val conn = cf.newConnection(host, port)
- val channel = conn.createChannel()
- configure(channel)
- (conn, channel)
- }
-
- /**
- * Override this to configure the Channel and Consumer.
- */
- def configure(channel: Channel)
-
- private val reconnectTimer = new Timer("AMQPReconnectTimer")
-
- protected def messageHandler = {
- case AMQPAddListener(a) => as ::= a
- case msg@AMQPMessage(t) => as.foreach(_ ! msg)
- case AMQPReconnect(delay: Long) =>
- try {
- val details = connect()
- conn = details._1
- channel = details._2
- println("AMQPDispatcher: Successfully reconnected to AMQP Server")
- } catch {
- // Attempts to reconnect again using geometric back-off.
- case e: Exception => {
- val amqp = this
- println("AMQPDispatcher: Will attempt reconnect again in " + (delay * 2) + "ms.")
- reconnectTimer.schedule(new TimerTask(){
- override def run = {
- amqp ! AMQPReconnect(delay * 2)
- }
- }, delay)
- }
- }
- case _ =>
- }
-}
-
-/**
- * Example consumer on an AMQP channel.
- */
-class SerializedConsumer[T](channel: Channel, a: LiftActor) extends DefaultConsumer(channel) {
- override def handleDelivery(tag: String, env: Envelope, props: AMQP.BasicProperties, body: Array[Byte]) {
- val routingKey = env.getRoutingKey
- val contentType = props.getContentType
- val deliveryTag = env.getDeliveryTag
- val in = new ObjectInputStream(new ByteArrayInputStream(body))
- val t = in.readObject.asInstanceOf[T];
- // Send t to all registered listeners.
- a ! AMQPMessage(t)
- channel.basicAck(deliveryTag, false);
- }
-}
-
-/**
- * Example Dispatcher that listens on an example queue and exchange. Use this
- * as your guiding example for creating your own Dispatcher.
- *
- */
-class ExampleSerializedAMQPDispatcher[T](factory: ConnectionFactory, host: String, port: Int)
- extends AMQPDispatcher[T](factory, host, port) {
- override def configure(channel: Channel) {
- // Set up the exchange and queue
- channel.exchangeDeclare("mult", "direct")
- channel.queueDeclare("mult_queue")
- channel.queueBind("mult_queue", "mult", "routeroute")
- // Use the short version of the basicConsume method for convenience.
- channel.basicConsume("mult_queue", false, new SerializedConsumer(channel, this))
- }
-}
-
-/**
- * Example class that accepts Strings coming in from the
- * ExampleSerializedAMQPDispatcher.
- */
-class ExampleStringAMQPListener {
- val params = new ConnectionParameters
- params.setUsername("guest")
- params.setPassword("guest")
- params.setVirtualHost("/")
- params.setRequestedHeartbeat(0)
-
- val factory = new ConnectionFactory(params)
- // thor.local is a machine on your network with rabbitmq listening on port 5672
- val amqp = new ExampleSerializedAMQPDispatcher[String](factory, "thor.local", 5672)
-
- // Example Listener that just prints the String it receives.
-
- val stringListener = new LiftActor {
- protected def messageHandler = {
- case msg@AMQPMessage(contents: String) => println("received: " + msg)
- }
- }
-
- amqp ! AMQPAddListener(stringListener)
-}
-
-}
-}
@@ -1,137 +0,0 @@
-/*
- * Copyright 2007-2011 WorldWide Conferencing, LLC
- *
- * 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.
- */
-
-package net.liftweb
-package amqp
-
-import net.liftweb.actor._
-import com.rabbitmq.client._
-import java.io.ByteArrayOutputStream
-import java.io.ObjectOutputStream
-
-/**
- * An actor with a long-lived connection to an AMQP exchange/queue.
- *
- * @see ExampleStringAMQPSender for an example use.
- * @author Steve Jenson (stevej@pobox.com)
- */
-abstract class AMQPSender[T](cf: ConnectionFactory, host: String, port: Int, exchange: String, routingKey: String) extends LiftActor {
- val conn = cf.newConnection(host, port)
- val channel = conn.createChannel()
-
- /**
- * Override this to use your own AMQP queue/exchange with the given channel.
- */
- def configure(channel: Channel): AnyRef
-
- def sendMsg(msg: T) {
- // Now write an object to a byte array and shove it across the wire.
- val bytes = new ByteArrayOutputStream
- val store = new ObjectOutputStream(bytes)
- store.writeObject(msg)
- store.close
- channel.basicPublish(exchange, routingKey, null, bytes.toByteArray)
- }
-
- protected def messageHandler = {
- case AMQPMessage(msg: T) => sendMsg(msg)
- }
-}
-
-/**
- * An example subclass of AMQPSender[T]
- *
- * An example of how to send messages to an AMQP queue/exchange. Notice that this
- * is setup with the same params as StringAQMPExample. After making a new instance of
- * StringAMQPExample, just send ExampleAMQPSender ! "hi" to see the message "hi"
- * appear in the output log. Fun and Easy!
- *
- * If you are planning to send lots of messages to lots of different exchange/queues,
- * consider creating Actor-based Senders, that will help your application to scale.
- */
-class StringAMQPSender(cf: ConnectionFactory, host: String, port: Int, exchange: String, routingKey: String)
- extends AMQPSender[String](cf, host, port, exchange, routingKey){
- override def configure(channel: Channel) = {
- val conn = cf.newConnection(host, port)
- val channel = conn.createChannel()
- channel
- }
-}
-
-/**
- * An Example of how to use the Example subclass of AMQPSender[T]. Still following?
- */
-class ExampleStringAMQPSender {
- val params = new ConnectionParameters
- // All of the params, exchanges, and queues are all just example data.
- params.setUsername("guest")
- params.setPassword("guest")
- params.setVirtualHost("/")
- params.setRequestedHeartbeat(0)
- val factory = new ConnectionFactory(params)
-
- val amqp = new StringAMQPSender(factory, "localhost", 5672, "mult", "routeroute")
- amqp ! AMQPMessage("hi")
-}
-
-/**
- * An example of using AMQP in a short-lived manner, setting up and tearing down
- * the connection whenever you need it. The long-lived example above is more
- * efficient with resources.
- */
-object ExampleDirectAMQPSender {
- def sendMsg[T](msg: T) {
- val params = new ConnectionParameters
- // All of the params, exchanges, and queues are all just example data.
- params.setUsername("guest")
- params.setPassword("guest")
- params.setVirtualHost("/")
- params.setRequestedHeartbeat(0)
- sendMsg(msg, params, "localhost", 5672)
- }
-
- def sendMsg[T](msg: T, params: ConnectionParameters, host: String, port: Int) {
- val factory = new ConnectionFactory(params)
- val conn = factory.newConnection(host, port)
- val channel = conn.createChannel()
- // Now write an object to a byte array and shove it across the wire.
- val bytes = new ByteArrayOutputStream
- val store = new ObjectOutputStream(bytes)
- store.writeObject(msg)
- store.close
- channel.basicPublish("mult", "routeroute", null, bytes.toByteArray)
- }
-}
-
-/**
- * Just a few examples of how you might test this. Mostly useful snippets
- * for me to run from script/console to see the bits flying.
- */
-object AMQPExampleFunPack {
- def directExample {
- val recv = new ExampleStringAMQPListener()
- // You should see the message 'hi'
- val sender = new ExampleStringAMQPSender()
- sender
- }
- def actorExample {
- val recv = new ExampleStringAMQPListener()
- // You probably know what message you are going to see. 'hello!'
- val sender = ExampleDirectAMQPSender.sendMsg("hello!")
- sender
- }
-}
-
@@ -1,69 +0,0 @@
-/*
- * Copyright 2007-2010 WorldWide Conferencing, LLC
- *
- * 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.
- */
-
-package net.liftweb {
-package ext_api {
-package facebook {
-
-import _root_.net.liftweb.http.{S, SessionVar}
-import _root_.net.liftweb.util.Helpers._
-import _root_.net.liftweb.common.{Box, Empty, Failure, Full}
-
-object Facebook {
- object SessionKey extends SessionVar[Box[String]](sessionKey)
-
- def canvasPage_? : Boolean = S.param("fb_sig_in_canvas") match {
- case Full(num) if toInt(num) == 1 => true
- case _ => false
- }
-
- def addedApplication_? : Boolean = S.param("fb_sig_added") match {
- case Full(num) if toInt(num) == 1 => true
- case _ => false
- }
-
- def loggedIn_? : Boolean = S.param("fb_sig_user") match {
- case Full(num) if toInt(num) > 0 => true
- case _ => false
- }
-
- def userId: Box[Int] = S.param("fb_sig_user") match {
- case Full(num) => Full(toInt(num))
- case _ => Empty
- }
-
- def userId_! : Int = userId.open_!
-
- private def authToken : Box[String] = S.param("auth_token")
-
- def sessionKey : Box[String] = S.param("fb_sig_session_key")
-
- def sessionKey_! : String = sessionKey.open_!
-
- def loginUrl: String = "http://www.facebook.com/login.php?api_key=" + FacebookRestApi.apiKey + "&v=1.0"
- def addUrl : String = "http://www.facebook.com/add.php?api_key=" + FacebookRestApi.apiKey
-
- // To conform with FacebookClient.State
- implicit val facebookClientState: FacebookClient.State = new {
- def sessionKey: Option[String] = S.param("fb_sig_session_key")
- def expiration: Option[Long] = S.param("fb_sig_expires").map[Long](_.toLong)
- def uid: Option[String] = S.param("fb_sig_user")
- }
-}
-
-}
-}
-}
Oops, something went wrong.

0 comments on commit d2ee7e0

Please sign in to comment.