Showing posts with label 2013. Show all posts
Showing posts with label 2013. Show all posts

Wednesday, December 4, 2013

JavaDay 2013: JCP & Adopt Kick off & What’s new in Java SE, EE, ME, Embedded world & new Strategy

"What’s new in Java SE, EE, ME, Embedded world & the new Strategy" and "Drive yourself, community with JCP & adopts to professionalism" sessions


I would like to share my successfully Java day story, and my happens by the response of my last event.

I have successfully ran a JCP Kick off session titled "Drive yourself, community with JCP & adopts to professionalism" 2 hours followed by a session titled "What’s new in Java SE, EE, ME, Embedded world & new Strategy" for also 2 hours, last Saturday (30/11/2013) in Cairo University.

What’s new in Java SE, EE, ME, Embedded world & new Strategy;
In this presentation, I have presented the history of Java EE from v1.0 to our latest Java EE 7.0, what is new and a brief introduction to each minor and major change to existing JSRs, and new JSRs with code to show simplifications and enhancements.

Also talked about our future Java EE 8 components alongside JDK 8 with major updates and JSRs, profiling concepts and more.

Lastly, I have explained the IoT concepts with demo. Intro to the importance of Java Embedded systems world. With intro to Raspberry Pi and dukePad.


Drive yourself, community with JCP & adopts to professionalism;
This is an overview presentation about JCP organization, its roles, process, and output. With a detailed explanation of each group role and their output. In addition, to encourage community to participate in JCP, and being valuable members and experience input to the community.


Agenda for both sessions:
http://egjug.org/page/java_ee_7_8_and_beyond

The attendees almost was Professionals, Students, Assistant teachers in Faculty of computer science and Doctors as well.

The main comments I got from all attendees via feedback by the end of sessions, via mails, Facebook, twitter, Google+, and LinkedIn was very positive the information they got also the content. They encourage participating in JCP program that I will lead under EGJUG.

In addition, I got a request to arrange with faculty teacher assistants to hold workshops, in their faculties sponsored by university for their students and assist teachers to get hands on experience on new Java technology as they interested to make it a curriculum in the future semesters of pre-graduate students, so the student can be ready for the market with latest tools.

I really was not except such a response but thanks God it was beyond my expectations.

With the co-operation with EGJUG, I will lead the JCP program, and we have created a participation form, collecting information to be used for participant evaluations to join the Group. And it will be sent with session materials.

Friday, September 13, 2013

JavaOne & OpenWorld 2013 Activities: One TUT Session, 2 JCP prize nominations, Oracle EMEA partner Dinner, and Architect club café member.


JavaOne and Oracle OpenWorld 2013:

Here are my activities during JavaOne and Oracle Open World 2013, San Francisco, California, USA, this year I have a lot of activities to do:

  1. Build.now(); True Real-Time Applications with Java EE 7 (A Hack Session) [TUT1805]

    This is for the second year; I have the chance to speak at JavaOne 2013. Last year my talks at JavaOne 2012 were about JDK7 NIO.2, and I give in details all what are new introduced by this amazing JSR supported with code.

    This year I am going to talk about JEE 7, especially my adopted JSRs, Websocket, JSON-P, RESTful, and JEE7 and the embracing of HTML5 APIs, alongside my testing contribution on FishCAT program of testing the Glassfish 4 until it becomes a public releases.

    Hope to see you all, and enjoy my tutorial, which leveraged with code examples.

    When: Wednesday, Sep 25, 10:00 AM - 12:00 PM - Parc 55 – Divisidero.

    Content and session registration visit this link.

  2. Nominated for 2 prizes at The 11th JCP Annual Awards 2013

    I am so happy to have the luck being nominated for two prizes at the 11th JCP annual award winning. One of the prizes is for my participation as JCP Member/Participant of the Year, while the other for Outstanding Adopt-a-JSR Participant.

    For nominations and information, please visit below links.

    When: Monday 23 September 2013, at the Hilton San Francisco, Cityscape, starting at 6:00 pm.
    Nomination links: Announcements on JCP Program Office blog, and JCP org events page.

  3. Oracle Eastern Europe, Middle East and Africa Partners Dinner at Oracle Open World 2013

    Every year I got this invitation. This is a gathering dinner for all Oracle partners in EMEA, of course there are a lot of peoples I already know, and new to know and this a good chance to know people and to open business discussions and have new experience, with introduction to my company as it is a big Oracle partner in Egypt.

    I hope to see you there.

    When: Sep 24, 2013 from 07:00 PM – 12:00 AM, at Terra Gallery 511 Harrison Street San Francisco 94105.

  4. EMEA and Oracle Architects Café at Open World.

    I got an invitation to attend this event it is especially for the Architects visiting Open World. It is a good opportunity to meet my peers, connect with Oracle experts, and discuss Oracle solutions with customers. . Oracle organizes the Architects Café for this reason.

    This BeNeLux Architects Networking Event is dedicated to IT issues and solutions, bringing together customers, partners and Oracle experts to discuss the IT solutions and trends in an informal environment.

    Architects Café
    Jasper’s Corner Tap & Kitchen, 401 Taylor Street, San Francisco, CA, USA.
    Monday 23 September 2013
    6:30 pm – 9:30 pm

Monday, July 8, 2013

Java SE 7: Refactoring your legacy java.io.File Code to elegant java.nio.file (NIO.2)


In my previous article, I have introduced all of the new functionalities, features and APIs, which are shipped with Java SE 7 release, and here we will see how to migrate or re-write your old IO to new NIO.2 code.

In my daily projects I am developing, I am depending extensively on I/O usage for exchanging files among my systems for integration, and there are a lot of boilerplate code, validations, exceptions checking and security related issues. Therefor I have decided to refactor my code especially critical one to Java SE 7 NIO.2 APIs.

In this article, I will show you a quick guide on how to refactor and map your legacy IO (Input/Output) code, which is prior to Java SE 7 ( java.io.File class was the only mechanism used for file I/O), to the new java.nio.file APIs which comes with rich and tremendous functionalities as part of Java SE 7 and above.

The Java 7 file I/O API JSR 203, has been completely re-architected in the Java SE 7 release; and because of that, you cannot swap one method for another method.

To use the rich functionality offered by the java.nio.file package, the easiest solution is to use the File.toPath method. If the previous statement is not sufficient for your needs, you must rewrite your file I/O code.

Before we dive into the mapping of the functionalities from legacy IO to the new one from Java 7 NIO, I have question to ask.

Why should I migrate from old IO to new NIO.2?

If you have developed more than a few applications based on java.io.File, then you should be familiar with not only its methods, but also its methods’ drawbacks.

For example, many of these methods do not throw exceptions when they fail, there is no real support for symbolic links, metadata access is inefficient, file renaming across platforms is inconsistent, and some methods do not scale, enhanced security and so on.

Let us begin the refactoring process:

The first milestone of refactoring java.io.File code may be considered the conversion of File objects into java.nio.file.Path objects through the java.io.File.toPath() method:


After conversion, you can exploit the Path features.

However, while this is the easiest solution, it may not always satisfy your needs.

Sometimes you will need to rewrite your file I/O code and align code to java.nio.file classes, and for this, you can use the one-by-one correspondence between the two APIs.

The following Table shows this correspondence; this table will make your code transition from Java 5 or 6 to Java 7 much easier:

Javadoc Description

java.io.File

java.nio.file

Class name correspondence

java.io.File

java.nio.file.Path

Tests this abstract pathname for equality with the given object

File.equals(Object)

Path.equals(Object)

Compares two abstract pathnames lexicographically

File.compareTo(File)

Path.compareTo(Path)

Returns the absolute pathname string of this abstract pathname

File.getAbsolutePath()

Path.toAbsolutePath()

Returns the absolute form of this abstract pathname

File.getAbsoluteFile()

Path.toAbsolutePath()

Returns the canonical pathname string of this abstract pathname

File.getCanonicalPath()

Path.toRealPath(LinkOption...)

Path.normalize()

Returns the canonical form of this abstract pathname

File.getCanonicalFile()

Path.toRealPath(LinkOption...)

Path.normalize()

Constructs a file: URI that represents this abstract pathname

File.toURI()

Path.toUri()

Tests whether the file denoted by this abstract pathname is a normal file

File.isFile()

Files.isRegularFile(Path, LinkOption ...)

Tests whether the file denoted by this abstract pathname is a directory

File.isDirectory()

Files.isDirectory(Path, LinkOption...)

Tests whether the file named by this abstract pathname is a hidden file

File.isHidden()

Files.isHidden(Path)

Tests whether the application can read the file denoted by this abstract pathname

File.canRead()

Files.isReadable(Path)

Tests whether the application can modify the file denoted by this abstract pathname

File.canWrite()

Files.isWritable(Path)

Tests whether the application can execute the file denoted by this abstract pathname

File.canExecute()

Files.isExecutable(Path)

Tests whether the file or directory denoted by this abstract pathname exists

File.exists()

Files.exists(Path, LinkOption...)

Files.notExists(Path, LinkOption ...)

Creates the directory named by this abstract pathname

File.mkdir()

Files.createDirectory(Path,

FileAttribute<?> ...)

Creates the directory named by this abstract pathname, including any necessary but nonexistent parent directories

File.mkdirs()

Files.createDirectories(Path,

FileAttribute<?> ...)

Atomically creates a new, empty file named by this abstract pathname if and only if a file with this name does not yet exist

File.createNewFile()

Files.createFile(Path, FileAttribute<?> ...)

Returns an array of strings naming the files and directories in the directory denoted by this abstract pathname

File.list()

File.listFiles()

Files.newDirectoryStream(Path)

Returns an array of strings naming the files and directories in the directory denoted by this abstract pathname that satisfy the specified filter

File.list(FilenameFilter)

File.listFiles(FileFilter)

File.listFiles(FilenameFilter)

Files.newDirectoryStream(Path, DirectoryStream.Filter<? super Path>)

Files.newDirectoryStream(Path, String)

The length of the file denoted by this abstract pathname

File.length()

Files.size(Path)

Deletes the file or directory denoted by this abstract pathname

File.delete()

Files.delete(Path)

Files.deleteIfExists(Path)

Renames the file denoted by this abstract pathname

File.renameTo(File)

Files.move(Path, Path, CopyOption)

Sets the owner or everybody’s execute permission for this abstract pathname

File.setExecutable(boolean, boolean)

Files.setAttribute(Path, String, Object, LinkOption...)

Sets the owner or everybody’s read permission for this abstract pathname

File.setReadable(boolean, boolean)

Files.setAttribute(Path, String, Object, LinkOption...)

Marks the file or directory named by this abstract pathname so that only read operations are allowed

File.setReadOnly()

Files.setAttribute(Path, String, Object, LinkOption...)

Sets the owner or everybody’s write permission for this abstract pathname

File.setWritable(boolean, boolean)

Files.setAttribute(Path, String, Object, LinkOption...)

Returns the time that the file denoted by this

abstract pathname was last modified

File.lastModified()

Files.getLastModifiedTime(Path path, LinkOption... options)

Sets the last-modified time of the file or directory named by this abstract pathname

File.setLastModified(long)

Files.setLastModifiedTime(Path, FileTime)

Creates an empty file in the default temporary-file directory, using the given prefix and suffix to generate its name

File.createTempFile(String, String)

Files.createTempFile(String prefix, String suffix, FileAttribute<?>... attrs)

Creates a new empty file in the specified directory, using the given prefix and suffix strings to generate its name

File.createTempFile(String, String, File)

Files.createTempFile(Path dir, String prefix, String suffix, FileAttribute<?>... attrs)

Returns the size of the partition named by this abstract pathname

File.getTotalSpace()

FileStore.getTotalSpace()

Returns the number of unallocated bytes in the partition named by this abstract path name

File.getFreeSpace()

FileStore.getUnallocatedSpace()

Returns the number of bytes available to this

virtual machine on the partition named by this abstract pathname

File.getUsableSpace()

FilesStore.getUsableSpace()

Lists the available file system roots

File.listRoots()

FileSystem.getRootDirectories()

Random access file

java.io.RandomAccessFile

java.nio.channels.SeekableByteChannel

Requests that the file or directory denoted by this abstract pathname be deleted when the virtual machine terminates

File.deleteOnExit()

Replaced by the DELETE_ON_CLOSE option

Combines two paths

new File(parent,"new_file")

parent.resolve("new_file")

Happy conversion, refactoring, mapping, and migrating IO from earlier JDKs to new JDK7 NIO2 :)

References:
  1. JDK7: Part 1- The power of java 7 NIO.2(JSR 203)(important concepts).
  2. File I/O(Featuring NIO.2).
  3. Package java.nio.file.
  4. Package java.io.
  5. File class.

JavaZone 2013: Javapocalypse, "Without Java you can't live :)"

"It's supposed to write once, run everywhere. But it's more like write once, ruin everything..."

http://www.javazone.no



Thursday, June 13, 2013

JEE: Java EE 7 (Glassfish v4.0) is out, putting the productivity at your hands.


My participation:

I am so proud of being part of Adopt-A-JSR program and my involvement in the testing, evaluating and evangelist JEE 7 JSRs and related technologies.
Alongside FishCAT program that target the enhancement and stabilizing Glassfish version 4.0.

Java EE 7 is out:

The most interesting and productive shipped with plumbing of cutting-edge (innovative) technology support; Java Enterprise Edition 7 (JEE 7) is out for public, as promised to be released in Q2 of 2013. The JSR 342 Java Platform, Enterprise Edition 7 could be downloaded from here.

Java EE 7 release is being designed with primary focus on the following features:

  1. Higher Productivity.
  2. HTML5 Support.

Alongside JEE 7 specification release, its modular and most efficient reference implementation application server Glassfish v4.0 is out for development of JEE 7 applications, and could be downloaded from glassfish.org web site. In addition, it is the world's first Java EE 7 Application Server.

Glassfish.org web site redesigned with new clear, fresh design as well. It looks very neat.

For release notes, it could be downloaded from here.

There are also many examples to get start, which could be found in documentation section.

Java EE 7 IDE is out:

For sake of development and get your hands dirt with JEE 7 specification that should be tested on Glassfish v4.0, there is a Netbeans 7.3.1 IDE, which includes support for JEE 7 full JSRs stack. It could be also downloaded from netbeans.org. Also, bear in mind that Netbeans JEE version includes Glassfish v4.0.

Consult the following page to see more IDEs (Integrated Development Environment) that supports Java EE 7 development: IDEs and plugins.

Try, Develop and have fun

As by now you have the JEE7 specification, Glassfish v4.0 and supported IDE Netbeans v7.3.1 (everything you need comes out-of-the-box without any plugin), so what are you waiting for, click to download and develop to get the feel of new smile of the technology.

Maven Development

For maven fans to develop a Java EE7 application here is the minimal POM pom.xml file:


For Java EE 7 Full Platform

For Java EE 7 Web Profile

For other Java EE 7 JSRs coordination, please visit Java EE 7 Maven Coordinates Wiki link.

Webcasts and Developer days

Besides the finished event "Java EE 7 Launch Webcast", there is another java developer day covering Java EE 7, SE, and Embedded named "Java Developer Day - June 25 - Java SE, Java EE & Java Embedded" that will be online at Tuesday, June 25, 2013, register here.

Tutorials and examples

Visit Java EE 7 Documentation: JEE 7 Tutorial, for full tutorials and examples on how to use the specification alongside its JSRs.

All my sessions, hacks and code contribution could be downloaded from this link under Adopt-A-JSR organization under Github Java EE 7 Hacks, codes and sessions.

Thursday, May 16, 2013

Conf: Will speak at the JEEConf 2013 Java Conference in Ukraine, Kiev.

I will give two presentations at two-day conference JEEConf 2013 in Kiev, Ukraine, at the end of coming May 2013 from 24 to 25.
It’s going to be the largest event for Java developers (about 1000 attendees). This is my first participation in this conference, and will go there with pleasure. Below are the descriptions of my two talks.

Note: My talks will be in English.
  1. Title: The Power of Java7 NIO.2 essential stuff.

    Abstract:
    In this session hear how a leading financial services company uses Java 7 NIO.2. This session will covers all the important essential aspects involved in developing NIO.2-based applications. It provides clear instructions for getting the most out of NIO.2 and offers many case studies to spice up your Java 7 applications with the new I/O capabilities.

    Contents:

    1. The Path class operations.
    2. Get/set file metadata through the new java.nio.file.attribute API.
    3. Manage symbolic and hard links.
    4. Manipulating files and directories through the new java.nio.file.Files API.

    Time allocated: 50 min.

    Date/Time and Venue: From: 14:30 To:15:20 Kiev time, @ 24/5/2013 in STAGE B(150).

  2. Title: The Power of Java7 NIO.2 advanced concepts.

    Abstract:
    In this session hear how a leading financial services company uses Java 7 NIO.2. This session will covers all the important aspects involved in developing advanced NIO.2-based applications. It provides clear instructions for getting the most out of NIO.2 and offers many case studies to spice up your Java 7 applications with the new I/O capabilities.

    Contents:

    1. The Path class operations.
    2. Need to copy, move, or delete an entire directory? Use the FileVisitor API.
    3. Explore the Watch Service API and file changed notification.
    4. Develop blocking/non-blocking socket-based applications. Learn how to develop Java network-based applications in blocking and non-blocking styles. Both TCP and UDP are covered in brief.
    5. The Asynchronous Channel API. You can develop asynchronous network based Java applications with a suite of classes and options.

    Time allocated: 50 min.

    Date/Time and Venue: From:12:00 To:12:50 Kiev time, @ 25/5/2013 in STAGE B(150).

Before the first session (it is very short time for each session, but I will try) to intreduce the adopt-A-JSR program, and in the second one I will introduce the Adopt-OpenJDK program as well so I can spread these programs knowledge, to get more participants.

Monday, May 6, 2013

Tunis JUG Day 2013: I will give 2 talks about (JEE7 JSR 356 Wbsockets, 353 JSON-P & Java8 NIOs)

The first edition of ESPRIT JUG DAY will be held on May 18 2013 from 8h00 to 19h00 in ESPRIT.

I am so happy to get an invitation to Tunisian JUG day that will be held in Carthage city, Tunis coming 18/5/2013 from JUG organizer & Leader Bessem Hamidi .


This is first time for the This JUG to organize such an event, and as I know, there are around 3000+ attendees will attend this JUG day; it is very big day event and number of attendees as well.

I will give 2 talks and they are:
  1. Submission Title:
    Build.now(); TRUE, Real Time Applications with JEE7 (A hack session).

    Submission Abstract:

    Historically, creating web applications that need bidirectional communication between a client and a server (e.g., instant messaging & gaming applications) has required an abuse of HTTP to poll the server for updates while sending upstream notifications as distinct HTTP calls.

    HTML5 specification includes the WebSockets (WS) protocol, I will introduce the Websocket JSR 356 (Tyrus RI), & JSON Processing JSR 353 for data exchange which is part of JEE7.

    In addition, there is a brief comparison of traditional HTTP & WS, followed by covering of how WebSockets works. You will see how using WS removes the overhead of heavy HTTP request and response headers with real case study. Finally, we will review the code of the Web app build on GlassFish 4 app server.

    Time: 17h00 - 18h30

  2. Submission Title:
    Java 8 NIO.2 API features, a walkthrough (The essential & advanced Stuff).

    Submission Abstract:

    Most of applications nowadays depend intensively on asynchronous or non-blocking IO and file manipulation operations and some other requirements that the standard IO won’t be able to fulfill and that’s the case for most applications today, that’s why people decided to move to NIO, in this session, hear how a leading financial services company uses Java NIO.2. This session will covers all the essential aspects involved in developing NIO.2-based applications day by day. It provides clear instructions for getting the most out of NIO.2 and offers many case studies to spice up your Java applications with the new I/O capabilities.

    Time: 11h00 - 13h00

Date: 18 of May 2013
Where: Esprit School Conference room, Carthage city, Tunis.

Before the first session I will introduce the adopt-A-JSR program, and in the second one I will introduce the Adopt-OpenJDK program as well so I can spread these programs knowledge, to get more participants.

Moreover, the JUG leader asked me to help them, on the adopt-A-JSR & Adopt-OpenJDK programs process and how they can participate. And indeed I will provide the help with all steps, materials and information alongside the required support to make it easy to participate. As they are very active locally and the JUG has many participants (around 3000+), so the adoption programs can gain benefits from their experiences.

The Esprit team is the organizer of this JUG Day, and they are very active and they are running a big Esprit school that graduate students in the following Majors Media, Telecom, software engineering and others. Also they have 8 classes running Java in this school.

They had made a very cool intro media for the event:



Thanks Very much Bessem Hamidiand Esprit Organisers.