Search Results

Search found 24 results on 1 pages for 'swank'.

Page 1/1 | 1 

  • Embedding swank-clojure in java program

    - by user237417
    Based on the Embedding section of http://github.com/technomancy/swank-clojure, I'm using the following to test it out. Is there a better way to do this that doesn't use Compiler? Is there a way to programmatically stop swank? It seems start-repl takes control of the thread. What would be a good way to spawn off another thread for it and be able to kill that thread programatically. import clojure.lang.Compiler; import java.io.StringReader; public class Embed { public static void main(String[] args) throws Exception { final String startSwankScript = "(ns my-app\n" + " (:use [swank.swank :as swank]))\n" + "(swank/start-repl) "; Compiler.load(new StringReader(startSwankScript)); } } Any help much appreciated, hhh

    Read the article

  • How to reconnect to slime/swank-clojure session?

    - by Mad Wombat
    It seems that whenever I disconnect from clojure slime session, I cannot reconnect again. I am using leiningen to start the swank session (with lein-swank plugin). So, every time I quit emacs (I know I shouldn't) or reboot/logout I have to restart both slime and swank. Is there a way to re-connect to a slime/clojure-swank session?

    Read the article

  • Good workflow with emacs+swank+slime+clojure?

    - by grm
    I just wanted opinion on good workflow using the emacs environment with clojure+swank+slime. I often find myself doing very repetitive keycommands and wonder if there is an obvious better way. I include swank with lein and start my project using lein swank from shell. Then I connect with emacs and do the correct use commands so that I can start to use (run-tests ). Then I do some coding and then want to test. To run the test I need to change buffer in emacs to the swank-repl C-x o, then I need to go to the prompt M-, then repeat the command M-p, then enter, maybe with an exception, then back to the code buffer and continue all over again with all the emacs commands. I find it a bit repetitive. I guess the solution would be to start hack on emacs and maybe add a shortcut for doing this repetitive task, but I would love to hear some suggestions because I can't be the only one who find this tedious?

    Read the article

  • Can I use swank-clojure with the clojure 1.2 master branch?

    - by Rob
    I'm happily using swank-clojure, installed via elpa. But I'd like to do some work with deftype, defprotocol, etc., which aren't aren't available in clojure 1.1. To use my own class paths, I'm using the excellent suggestion by Rick Moynihan in the stackoverflow question about setting custom classpaths, which was to set up a script like: #!/bin/bash java -server -cp "./lib/*":./src clojure.main -e "(do (require 'swank.swank) (swank.swank/start-repl))" And that works swimmingly if the clojure jar file in lib is 1.1, but with 1.2, it blows up: Exception in thread "main" java.lang.NoSuchMethodError: clojure.lang.RestFn.<init>(I)V (macroexpand.clj:1) at clojure.lang.Compiler.eval(Compiler.java:5274) at clojure.lang.Compiler.load(Compiler.java:5663) at clojure.lang.RT.loadResourceScript(RT.java:330) at clojure.lang.RT.loadResourceScript(RT.java:321) at clojure.lang.RT.load(RT.java:399) at clojure.lang.RT.load(RT.java:371) at clojure.core$load__5663$fn__5671.invoke(core.clj:4255) at clojure.core$load__5663.doInvoke(core.clj:4254) at clojure.lang.RestFn.invoke(RestFn.java:409) ...and many, many more So is there some magical incantation to make this work, or is clojure 1.2 compatibility not there yet?

    Read the article

  • Using slime's C-x C-e (Eval the form under the point) with swank-clojure in emacs

    - by hiheelhottie
    Hi, I'm using swank-clojure in emacs on OSX. I'm able to run a slime session. When I use C-x C-e on a simple form in a .clj file like (+ 7 7) I get an sldb buffer with Unable to resolve symbol: + in this context [Thrown class java.lang.Exception] I'm able to evaluate that form in the slime session directly. I was hoping the form in the clj file would get evaluated in the running slime session. Can someone explain how C-x C-e works in swank-clojure and how I can get the form to be evaluated in the running slime session? Thanks, hhh

    Read the article

  • Setting the Classpath and Accessing code from book: Programming Clojure

    - by user130153
    (I posted this same question on the Clojure list but haven't got an answer yet. Is anyone here ready to help?) I am going through Programming Clojure and I recently downloaded the code from the books official website. For other utils I can do, for example, (require 'clojure.contrib.str-utils) and it works. But how do I load code from the book? (require 'examples.introduction) throws the following exception: java.io.FileNotFoundException: Could not locate examples/ introduction__init.class or examples/introduction.clj on classpath: (NO_SOURCE_FILE:0) [Thrown class clojure.lang.Compiler$CompilerException] Here is the full backtrace: Backtrace: 0: clojure.lang.Compiler.eval(Compiler.java:4543) 1: clojure.core$eval__3990.invoke(core.clj:1728) 2: swank.commands.basic$eval_region__686.invoke(basic.clj:36) 3: swank.commands.basic$listener_eval__695.invoke(basic.clj:50) 4: clojure.lang.Var.invoke(Var.java:346) 5: user$eval__1200.invoke(NO_SOURCE_FILE) 6: clojure.lang.Compiler.eval(Compiler.java:4532) 7: clojure.core$eval__3990.invoke(core.clj:1728) 8: swank.core$eval_in_emacs_package__307.invoke(core.clj:55) 9: swank.core$eval_for_emacs__384.invoke(core.clj:123) 10: clojure.lang.Var.invoke(Var.java:354) 11: clojure.lang.AFn.applyToHelper(AFn.java:179) 12: clojure.lang.Var.applyTo(Var.java:463) 13: clojure.core$apply__3243.doInvoke(core.clj:390) 14: clojure.lang.RestFn.invoke(RestFn.java:428) 15: swank.core$eval_from_control__310.invoke(core.clj:62) 16: swank.core$eval_loop__313.invoke(core.clj:67) 17: swank.core$spawn_repl_thread__445$fn__476$fn__478.invoke(core.clj: 173) 18: clojure.lang.AFn.applyToHelper(AFn.java:171) 19: clojure.lang.AFn.applyTo(AFn.java:164) 20: clojure.core$apply__3243.doInvoke(core.clj:390) 21: clojure.lang.RestFn.invoke(RestFn.java:428) 22: swank.core$spawn_repl_thread__445$fn__476.doInvoke(core.clj:170) 23: clojure.lang.RestFn.invoke(RestFn.java:402) 24: clojure.lang.AFn.run(AFn.java:37) 25: java.lang.Thread.run(Unknown Source) I am trying both Clojure Box and Enclojure in NetBeans on Windows XP. Is it a classpath issue? Where should I place the folder that contains code from the book? Please help me out with my variable enviroment settings as well.

    Read the article

  • How can I define a clojure type that implements the servlet interface?

    - by Rob Lachlan
    I'm attempting to use deftype (from the bleeding-edge clojure 1.2 branch) to create a java class that implements the java Servlet interface. I would expect the code below to compile (even though it's not very useful). (ns foo [:import [javax.servlet Servlet ServletRequest ServletResponse]]) (deftype servlet [] javax.servlet.Servlet (service [this #^javax.servlet.ServletRequest request #^javax.servlet.ServletResponse response] nil)) But it doesn't compile. The compiler produces the message: Mismatched return type: service, expected: void, had: java.lang.Object [Thrown class java.lang.IllegalArgumentException] Which doesn't make sense to me, because I'm returning nil. So the fact that the return type of the method is void shouldn't be a problem. For instance, for the java.util.Set interface: (deftype bar [#^Number n] java.util.Set (clear [this] nil)) compiles without issue. So what am I doing wrong with the Servlet interface? To be clear: I know that the typical case is to subclass one of the servlet abstract classes rather than implement this interface directly, but it should still be possible to do this. Stack Trace: The stack trace for the (deftype servlet... is: Mismatched return type: service, expected: void, had: java.lang.Object [Thrown class java.lang.IllegalArgumentException] Restarts: 0: [ABORT] Return to SLIME's top level. Backtrace: 0: clojure.lang.Compiler$NewInstanceMethod.parse(Compiler.java:6461) 1: clojure.lang.Compiler$NewInstanceExpr.build(Compiler.java:6119) 2: clojure.lang.Compiler$NewInstanceExpr$DeftypeParser.parse(Compiler.java:6003) 3: clojure.lang.Compiler.analyzeSeq(Compiler.java:5289) 4: clojure.lang.Compiler.analyze(Compiler.java:5110) 5: clojure.lang.Compiler.analyze(Compiler.java:5071) 6: clojure.lang.Compiler.eval(Compiler.java:5347) 7: clojure.lang.Compiler.eval(Compiler.java:5334) 8: clojure.lang.Compiler.eval(Compiler.java:5311) 9: clojure.core$eval__4350.invoke(core.clj:2364) 10: swank.commands.basic$eval_region__673.invoke(basic.clj:40) 11: swank.commands.basic$eval_region__673.invoke(basic.clj:31) 12: swank.commands.basic$eval__686$listener_eval__687.invoke(basic.clj:54) 13: clojure.lang.Var.invoke(Var.java:365) 14: foo$eval__2285.invoke(NO_SOURCE_FILE) 15: clojure.lang.Compiler.eval(Compiler.java:5343) 16: clojure.lang.Compiler.eval(Compiler.java:5311) 17: clojure.core$eval__4350.invoke(core.clj:2364) 18: swank.core$eval_in_emacs_package__320.invoke(core.clj:59) 19: swank.core$eval_for_emacs__383.invoke(core.clj:128) 20: clojure.lang.Var.invoke(Var.java:373) 21: clojure.lang.AFn.applyToHelper(AFn.java:169) 22: clojure.lang.Var.applyTo(Var.java:482) 23: clojure.core$apply__3776.invoke(core.clj:535) 24: swank.core$eval_from_control__322.invoke(core.clj:66) 25: swank.core$eval_loop__324.invoke(core.clj:71) 26: swank.core$spawn_repl_thread__434$fn__464$fn__465.invoke(core.clj:183) 27: clojure.lang.AFn.applyToHelper(AFn.java:159) 28: clojure.lang.AFn.applyTo(AFn.java:151) 29: clojure.core$apply__3776.invoke(core.clj:535) 30: swank.core$spawn_repl_thread__434$fn__464.doInvoke(core.clj:180) 31: clojure.lang.RestFn.invoke(RestFn.java:398) 32: clojure.lang.AFn.run(AFn.java:24) 33: java.lang.Thread.run(Thread.java:637)

    Read the article

  • How do I set up the Clojure classpath in Emacs after installing with ELPA?

    - by derefed
    I'm trying to add paths to my classpath in the Clojure REPL that I've set up in Emacs using ELPA. Apparently, this isn't the $CLASSPATH environment variable, but rather the swank-clojure-classpath variable that Swank sets up. Because I used ELPA to install Swank, Clojure, etc., there are a ton of .el files that take care of everything instead of my .emacs file. Unfortunately, I can't figure out how to change the classpath now. I've tried using (setq 'swank-clojure-extra-classpaths (list ...)) both before and after the ELPA stuff in my .emacs, and I've tried adding paths directly to swank-clojure-classpath in .emacs, .emacs.d/init.el, and .emacs.d/user/user.el, but nothing works. What I'm ultimately trying to do is to add both the current directory "." and the directory in which I keep my Clojure programs. I'm assuming swank-clojure-classpath is the thing I need to set here. Thanks for your help.

    Read the article

  • How do I set up the Clojure classpath in Emacs after installing with ELPA?

    - by derefed
    I'm trying to add paths to my classpath in the Clojure REPL that I've set up in Emacs using ELPA. Apparently, this isn't the $CLASSPATH environment variable, but rather the swank-clojure-classpath variable that Swank sets up. Because I used ELPA to install Swank, Clojure, etc., there are a ton of .el files that take care of everything instead of my .emacs file. Unfortunately, I can't figure out how to change the classpath now. I've tried using (setq 'swank-clojure-extra-classpaths (list ...)) both before and after the ELPA stuff in my .emacs, and I've tried adding paths directly to swank-clojure-classpath in .emacs, .emacs.d/init.el, and .emacs.d/user/user.el, but nothing works. What I'm ultimately trying to do is to add both the current directory "." and the directory in which I keep my Clojure programs. I'm assuming swank-clojure-classpath is the thing I need to set here. Thanks for your help.

    Read the article

  • Efficient Clojure workflow?

    - by Alex B
    I am developing a pet project with Clojure, but wonder if I can speed up my workflow a bit. My current workflow (with Compojure) is: Start Swank with lein swank. Go to Emacs, connect with M-x slime-connect. Load all existing source files one by one. This also starts a Jetty server and an application. Write some code in REPL. When satisfied with experiments, write a full version of a construct I had in mind. Eval (C-c C-c) it. Switch REPL to namespace where this construct resides and test it. Switch to browser and reload browser tab with the affected page. Tweak the code, eval it, check in the browser. Repeat any of the above. There are a number of annoyances with it: I have to switch between Emacs and the browser (or browsers if I am testing things like templating with multiple browsers) all the time. Is there a common idiom to automate this? I used to have a JavaScript bit that reloads the page continuously, but it's of limited utility, obviously, when I have to interact with the page for more than a few seconds. My JVM instance becomes "dirty" when I experiment and write test functions. Basically namespaces become polluted, especially if I'm refactoring and moving the functions between namespaces. This can lead to symbol collisions and I need to restart Swank. Can I undef a symbol? I load all source files one by one (C-c C-k) upon restarting Swank. I suspect I'm doing it all wrong. Switching between the REPL and the file editor can be a bit irritating, especially when I have a lot of Emacs tabs open, alongside the browser(s). I'm looking for ways to improve the above points and the entire workflow in general, so I'd appreciate if you'd share yours. P. S. I have also used Vimclojure before, so Vimclojure-based workflows are welcome too.

    Read the article

  • configuring slime in emacs

    - by CodeKingPlusPlus
    I am in the process of configuring slime for emacs. So far I have read about basic functionality for common lisp such as C-c C-q which invokes the command slime-close-parens-at-point which places the proper number of parens where your mouse is. Another command that seemed cool was invoked by C-c C-c and it would pass the code you are editing in a buffer to the REPL, and "compile" it. Why won't these commands work for me? Anyway, I have downloaded slime via M-x list-packages and do not seem to have this functionality (C-h w and then any of these commands tells me that these commands do note exist). So, I saw a bunch of other slime extensions such as slime-repl', 'slime-fuzzy' and 'hippie-expand-slime'. So I again usedM-x list-packages` and downloaded them. Still I did not have these commands. Here is the content of my emacs file relevant to slime: ;;;Common Lisp and Slime (add-to-list 'load-path "/home/s2s2/.emacs.d/elpa/slime-20130626.1151") (add-to-list 'load-path "/home/s2s2/.emacs.d/elpa/slime-repl-201000404") (add-to-list 'load-path "/home/s2s2/.emacs.d/elpa/hippie-expand-slime-20130226.1656") (add-to-list 'load-path "/home/s2s2/.emacs.d/elpa/slime-fuzzy-20100404") (require 'slime) (setq slime-lisp-implementations `((sbcl ("/usr/bin/sbcl")) (ecl ("/usr/bin/ecl")) (clisp ("/usr/bin/clisp" "-q -I")))) (require 'slime-repl) (require 'slime-fuzzy) (require 'hippie-expand-slime) When I execute M-x slime I get the following message in the inferior-lisp buffer where I can execute common lisp code (however, shouldn't this be the slime-repl since I required it?): STYLE-WARNING: redefining EMACS-INSPECT (#<BUILT-IN-CLASS T>) in DEFMETHOD STYLE-WARNING: Implicitly creating new generic function STREAM-READ-CHAR-WILL-HANG-P. WARNING: These Swank interfaces are unimplemented: (DISASSEMBLE-FRAME SLDB-BREAK-AT-START SLDB-BREAK-ON-RETURN) ;; Swank started at port: 46533. Then a slime-error buffer is created with the contents: Invalid protocol message: Symbol "CREATE-REPL" not found in the SWANK package. Line: 1, Column: 28, File-Position: 28 Stream: #<SB-IMPL::STRING-INPUT-STREAM {10056B9C33}> (:emacs-rex (swank:create-repl nil) "COMMON-LISP-USER" t 5) How should I modify my emacs file to give me the functionality of those commands? In my emacs file am I not loading the necessary files? Do I need to install an additional package? If you need more information let me know! All help is much appreciated!

    Read the article

  • Setting slime-enable-evaluate-in-emacs

    - by Tyler
    Hi, I am using SBCL with slime, and have the following code: (swank::eval-in-emacs '(with-current-buffer (slime-repl-buffer) (insert (propertize "foo" 'font-lock-face '(:foreground "red"))))) (print "here is some text") In general if I try to execute anything with swank:: prefixed to it emacs will give a security error, and this particular one tells me I need to set slime-enable-evaluate-in-emacs to true. Where is this value? I haven't been able to find a slime or swank config. & settings file. Thanks much.

    Read the article

  • leiningen: missing super-pom

    - by Arthur Ulfeldt
    if I enable eith the clojure-couchdb or swank-clojure then lein deps fails because org.apache.maven:super-pom:jar:2.0 is missing :dependencies [[org.clojure/clojure "1.1.0-master-SNAPSHOT"] [org.clojure/clojure-contrib "1.0-SNAPSHOT"] [clojure-http-client "1.0.0-SNAPSHOT"] [org.apache.activemq/activemq-core "5.3.0"] ; [org.clojars.the-kenny/clojure-couchdb "0.1.3"] ; [org.clojure/swank-clojure "1.1.0"] ]) this error: Path to dependency: 1) org.apache.maven:super-pom:jar:2.0 2) org.clojure:swank-clojure:jar:1.1.0 ---------- 1 required artifact is missing. for artifact: org.apache.maven:super-pom:jar:2.0 from the specified remote repositories: clojars (http://clojars.org/repo/), clojure-snapshots (http://build.clojure.org/snapshots), central (http://repo1.maven.org/maven2) what is super-pom. why do these packages need it and where can I get it.

    Read the article

  • Using clojure.contrib functions in slime REPL

    - by Tyler
    I want to use the functions in the clojure.contrib.trace namespace in slime at the REPL. How can I get slime to load them automatically? A related question, how can I add a specific namespace into a running repl? On the clojure.contrib API it describes usage like this: (ns my-namespace (:require clojure.contrib.trace)) But adding this to my code results in the file being unable to load with an "Unable to resolve symbol" error for any function from the trace package. I use leiningen 'lein swank' to start the ServerSocket and the project.clj file looks like this (defproject test-project "0.1.0" :description "Connect 4 Agent written in Clojure" :dependencies [[org.clojure/clojure "1.2.0-master-SNAPSHOT"] [org.clojure/clojure-contrib "1.2.0-SNAPSHOT"]] :dev-dependencies [[leiningen/lein-swank "1.2.0-SNAPSHOT"] [swank-clojure "1.2.0"]]) Everything seems up to date, i.e. 'lein deps' doesn't produce any changes. So what's up?

    Read the article

  • How to make emacs properly indent if-then-else construct in elisp

    - by Mad Wombat
    When I indent if-then-else construct in emacs lisp, the else block doesn't indent properly. What I get is: (defun swank-clojure-decygwinify (path) "Convert path from CYGWIN UNIX style to Windows style" (if (swank-clojure-cygwin) (replace-regexp-in-string "\n" "" (shell-command-to-string (concat "cygpath -w " path))) (path))) where else form is not indented at the same level as the then form. Is there an obvious way to fix this?

    Read the article

  • Managing log4j.properties with lein

    - by erikcw
    I'm trying to figure out how I can manage my log4j.properties file with leiningen. I'd like to be able to automatically include the file in the jars that lein creates as well as have the properties file be accessible to "lein swank" (and lein repl). Right now I have the file in my project "root", but I get this error when I using logging from swank [null] log4j:WARN No appenders could be found for logger (com.dev). [null] log4j:WARN Please initialize the log4j system properly. Thanks!

    Read the article

  • Clojure Box: Problem with classpath (noob question)

    - by Rainer
    Hello, I'm stuck with "Programming Clojure" on page 37 on a Windows 7 machine. After downloading the "examples" dir into "C:/clojure", I typed: user (require 'examples.introduction) and I got ; Evaluation aborted. java.io.FileNotFoundException: Could not locate examples/ introduction__init.class or examples/introduction.clj on classpath: (NO_SOURCE_FILE:0) My .emacs file looks like this: (setq swank-clojure-extra-classpaths (list "C:/Clojure")) The files in C:/Clojure are there (I triplechecked) Any help will be appreciated.

    Read the article

  • Clojure evaluation without SLIME

    - by Denis
    Hi, I'm a starter with Emacs (but quite experienced Vim user) and trying to play with Emacs+Clojure combination. Maybe my setup will be unusual for Emacs world, as I'm not using SLIME/swank-clojure, but Emacs + eshell with running clojure REPL in it, mostly due simplicity (or probably because SLIME quite scares me off :D). So, maybe there is a Emacs guru that can help me here: does exists any shortcut (or maybe some elisp sample) to copy/paste code chunks (sexps) from editing buffer to eshell (and possibly execute it)? Thanks.

    Read the article

  • Clojure editor/IDE recommendations on OS X

    - by Julien Chastang
    I am starting to learn the Clojure programming language. Are there any recommendations for Clojure editors/IDEs on OS X? Update 2009-9-23: The clojure space has changed tremendously since I originally posted this question. Many of the links below, especially those that refer to clojure-mode with emacs, are out-of-date. The best clojure IDE I found was the enclojure Netbeans plugin which was recently released (2009-08-25). Update 2010-4-30: Here is another very good link on this subject by Lau B. Jensen. Also, for my own clojure development, I have actually moved to emacs / swank-clojure.

    Read the article

  • Emacs: ac-slime for auto complete

    - by Boris
    I am trying to add auto complete for *.lisp files. My slime setting is: (add-to-list 'load-path "~/.emacs.d/plugins/slime/") (setq slime-lisp-implementations '((sbcl ("/opt/sbcl/bin/sbcl" "--core" "/opt/sbcl/lib/sbcl/sbcl.core") :coding-system utf-8-unix :env ("SBCL_HOME=/opt/sbcl/lib/sbcl")) (ccl ("/opt/ccl/lx86cl64") :coding-system utf-8-unix))) (require 'slime-autoloads) (slime-setup '(slime-fancy)) And ac-slime setting is: (require 'ac-slime) (add-hook 'slime-mode-hook 'set-up-slime-ac) (add-hook 'slime-repl-mode-hook 'set-up-slime-ac) (eval-after-load "auto-complete" '(add-to-list 'ac-modes 'slime-repl-mode)) Each time I type a word in *.lisp file, auto complete popups some candidates but after a second minibuffer outputs error in process filter: Reply to canceled synchronous eval request tag=slime-result-6-19579 sexp=(swank:simple-completions "de" (quote "COMMON-LISP-USER")) and the popup stuck for a while. After that I can continue my selection. My question is how to remove this error and stuck? Any help is appreciated.

    Read the article

  • The Evolution of Television and Home Entertainment

    - by Bill Evjen
    This is a group that is focused on entertainment in the aviation industry. I am attending their conference for the first time as it relates to my job at Swank Motion Pictures and what we do for our various markets. I will post my notes here. The Evolution of Television and Home Entertainment by Patrick Cosson, Veebeam TV has been the center of living rooms for sometime. Conversations and culture evolve around the TV. The way we consume this content has dramatically been changing. After TV, we had the MTV revolution of TV. It has created shorter attention spans, it made us more materialistic, narcissistic, and not easily impressed. Then we came to the Internet. The amount of content has expanded. It contains a ton of user-generated content, provides filtering, organization, distribution. We now have a problem. We are in the age of digital excess. We can access whatever we want. In conjunction with this – we are moving. The challenge we have now is curation. The trends  we see: rapid shift from scheduled to on demand consumption. A move to Internet protocols from cable Rapid fragmentation of media a transition from the TV set to a variety of screens Social connections bring mediators and amplifiers. TiVo – the shift to on demand It is because of a time-crunch Provides personal experiences Once old consumption habits are changed, there is no way back! Experiences are that people are loading up content and then bringing it with them on planes, to hotels, etc. Rapid fragmentation of media sources Many new professional content sources and channels, the rise of digital distribution, and the rise of user-generated content contribute to the wealth of content sources and abundant choice. Netflix, BBC iPlayer, hulu, Pandora, iTunes, Amazon Video, Vudu, Voddler, Spotify (these companies didn’t exist 5 years ago). People now expect this kind of consumption. People are now thinking how to deliver all these tools. Transition from the TV set to multi-screens The TV screen has traditionally been the dominant consumption screen for TV and video. Now the PC, game consoles, and various mobile devices are rapidly becoming common video devices. Multi-screens are now the norm. Social connections becoming key mediators What increasingly funnels traffic on the web, social networking enablers, will become an integral part of the discovery, consumption and sharing model for Television. The revolution will be broadcasted on Facebook and Twitter. There is business disruption There are a lot of new entrants Rapid internationalization Increasing competition from existing media players A fragmenting audience base Web browser Freedom to access any site The fight over the walled garden Most devices are not powerful enough to support a full browser PC will always be present in the living room Wireless link between PC and TV Output 1080p, plays anything, secure Key players and their challenges Services Internet media is increasingly interconnected to social media and publicly shared UGC Content delivery moving to IPTV Rights management issues are creating silos and hindering a great user experience and growth Devices Devices are becoming people’s windows into all kinds of media from all kinds of sources There won’t be a consolidation of the device landscape, rather the opposite Finding the right niche makes the most sense. We are moving to an on demand world of streaming world. People want full access to anything.

    Read the article

  • Jersey 2 in GlassFish 4 - First Java EE 7 Implementation Now Integrated (TOTD #182)

    - by arungupta
    The JAX-RS 2.0 specification released their Early Draft 3 recently. One of my earlier blogs explained as the features were first introduced in the very first draft of the JAX-RS 2.0 specification. Last week was another milestone when the first Java EE 7 specification implementation was added to GlassFish 4 builds. Jakub blogged about Jersey 2 integration in GlassFish 4 builds. Most of the basic functionality is working but EJB, CDI, and Validation are still a TBD. Here is a simple Tip Of The Day (TOTD) sample to get you started with using that functionality. Create a Java EE 6-style Maven project mvn archetype:generate -DarchetypeGroupId=org.codehaus.mojo.archetypes -DarchetypeArtifactId=webapp-javaee6 -DgroupId=example -DartifactId=jersey2-helloworld -DarchetypeVersion=1.5 -DinteractiveMode=false Note, this is still a Java EE 6 archetype, at least for now. Open the project in NetBeans IDE as it makes it much easier to edit/add the files. Add the following <respositories> <repositories> <repository> <id>snapshot-repository.java.net</id> <name>Java.net Snapshot Repository for Maven</name> <url>https://maven.java.net/content/repositories/snapshots/</url> <layout>default</layout> </repository></repositories> Add the following <dependency>s <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.10</version> <scope>test</scope></dependency><dependency> <groupId>javax.ws.rs</groupId> <artifactId>javax.ws.rs-api</artifactId> <version>2.0-m09</version> <scope>test</scope></dependency><dependency> <groupId>org.glassfish.jersey.core</groupId> <artifactId>jersey-client</artifactId> <version>2.0-m05</version> <scope>test</scope></dependency> The complete list of Maven coordinates for Jersey2 are available here. An up-to-date status of Jersey 2 can always be obtained from here. Here is a simple resource class: @Path("movies")public class MoviesResource { @GET @Path("list") public List<Movie> getMovies() { List<Movie> movies = new ArrayList<Movie>(); movies.add(new Movie("Million Dollar Baby", "Hillary Swank")); movies.add(new Movie("Toy Story", "Buzz Light Year")); movies.add(new Movie("Hunger Games", "Jennifer Lawrence")); return movies; }} This resource publishes a list of movies and is accessible at "movies/list" path with HTTP GET. The project is using the standard JAX-RS APIs. Of course, you need the trivial "Movie" and the "Application" class as well. They are available in the downloadable project anyway. Build the project mvn package And deploy to GlassFish 4.0 promoted build 43 (download, unzip, and start as "bin/asadmin start-domain") as asadmin deploy --force=true target/jersey2-helloworld.war Add a simple test case by right-clicking on the MoviesResource class, select "Tools", "Create Tests", and take defaults. Replace the function "testGetMovies" to @Testpublic void testGetMovies() { System.out.println("getMovies"); Client client = ClientFactory.newClient(); List<Movie> movieList = client.target("http://localhost:8080/jersey2-helloworld/webresources/movies/list") .request() .get(new GenericType<List<Movie>>() {}); assertEquals(3, movieList.size());} This test uses the newly defined JAX-RS 2 client APIs to access the RESTful resource. Run the test by giving the command "mvn test" and see the output as ------------------------------------------------------- T E S T S-------------------------------------------------------Running example.MoviesResourceTestgetMoviesTests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.561 secResults :Tests run: 1, Failures: 0, Errors: 0, Skipped: 0 GlassFish 4 contains Jersey 2 as the JAX-RS implementation. If you want to use Jersey 1.1 functionality, then Martin's blog provide more details on that. All JAX-RS 1.x functionality will be supported using standard APIs anyway. This workaround is only required if Jersey 1.x functionality needs to be accessed. The complete source code explained in this project can be downloaded from here. Here are some pointers to follow JAX-RS 2 Specification Early Draft 3 Latest status on specification (jax-rs-spec.java.net) Latest JAX-RS 2.0 Javadocs Latest status on Jersey (Reference Implementation of JAX-RS 2 - jersey.java.net) Latest Jersey API Javadocs Latest GlassFish 4.0 Promoted Build Follow @gf_jersey Provide feedback on Jersey 2 to [email protected] and JAX-RS specification to [email protected].

    Read the article

1