The Source for Java Technology Collaboration
User: Password:



Janice J. Heiss's Blog

Distributed Archives


Dancing While Gaming – Multitasking VMs on Real Devices

Posted by hiheiss on May 19, 2006 at 08:35 PM | Permalink | Comments (2)

The JavaOne session, “Dancing While Gaming – Multitasking VMs on Real Devices”, focused on helping developers gain a wider and deeper understanding of the Multitasking VM implementation on real devices based on the interaction between Sun and Samsung who are engaged in a joint collaboration through the work of Jae Hyou Lee of Samsung Electronics and Yaniv Shani of Sun.

MVM deployment is based on the Sun JWC1.1.3 (Java Wireless Client 1.1.3) which comes with multi-tasking capabilities. The MVM deploys most of the MSA (Mobile Service Architecture) JSRs. It has been tested with hundreds of games and applications from leading content providers.

So what is MVM? The Multi-Tasking Virtual Machine is a technology that allows the end-user to execute multiple Java applications simultaneously. MVM enables preferred and rich applications like MP3 playing, Instant Messaging and mail clients. Users of MVM want to run multiple Java applications simultaneously and want to be able to switch applications very rapidly. The typical MVM player might be a teenager who loves to listen to MP3 players, chat with friends over the Net, and play video games simultaneously. Multi-tasking capabilities enable all these activities to be conducted on the same device at the same time.

The Isolation Model

To execute multiple applications, the isolation model was introduced in the VM. Each application runs in its own logical Virtual Machine environment, called an isolate. Within the JVM, each isolate is represented as a task. A task consists of one or more Java threads of execution. All tasks execute in the same single OS task context. All tasks share constant data structure and runtime support functions. Each task encapsulates non-sharable program state MVM.

“In the CLCD space, we would like to address limited operating systems that lack native process modeling support,” said Shani. “This is the main reason why in the CLCD space, the VM implementation conducts both the Java task and Java thread scheduling internally within the VM.”

Implementation Details

Each task has a separate, private copy of the static variables of all the loaded Java classes. Static variables are only global to all threads within a particular task. Each task maintains a private copy of ‘count’. The Class representation is shared. Synchronization has to be task private. Threads in one task cannot block threads in another task. Blocking threads across tasks isn’t allowed.

Resource Management

The low-level part of the VM is responsible for all CPU time and memory resources in order to ensure that all tasks get their “fair” share. Other resources, such as network bandwidth and communication ports are managed by the profile layer.

Resource Management – Scheduling

Tasks and threads are scheduled internally by the JVM. Fair scheduling algorithm is used for task scheduling in order to prevent one task from taking disproportionate CPU time and causing other tasks to stop. The ‘isolate’ class offers a set of APIs to modify the priority levels for each task. In most cases MIDlets that execute in the foreground get to have more CPU cycles compared to others that run in the background.

Resource Management – Memory

The VM requires a large consecutive memory block from the underlying OS. Allocations for all tasks are made from this same global heap region. The VM has a bookkeeping mechanism that accounts for each task’s total heap memory consumption. The VM injects OutOfMemoryError as needed to inform tasks that heap space has become scarce.

The Profile Level

The presentation turned to what must be done at the profile level to transform their implementation into one capable of multi-tasking. They have been using Sun’s latest JWC1.1.3, which comes with multi-tasking capabilities. It allows only a single MIDlet to execute in the foreground at a certain time.

A MIDlet application is said to be in the foreground when:

-- Its displayable controls the display.
-- It handles events from the user input mechanism since they are automatically routed to it.

An application is in the background when:

-- Its displayable does not control the display.
-- It does not handle the user input mechanism.
-- Zero or more MIDlets can execute in the Background
at a time.

The application manager is critical for task switching. They use a resident Java MIDlet for the application manager; it is launched in the background when the device ends its boot phase. When users switch it to the foreground, they see a list of all running applications and can switch between them quickly. The app manager also displays background MIDlet alerts, when one wants to drive the user intention.

They next displayed some demos showing how to switch MIDlets to the background and switching between MIDlet states.

Switching a MIDlet to the Background

A short ‘hot’ key press is used for switching between running apps.
Upon a short ‘hot' key press the foreground MIDlet will be
placed in the background and the main device menu will be
displayed on the screen.

Upon a long ‘Hot’ key press the foreground MIDlet will be
placed in the background and the ‘Application manager’ will
be displayed on the screen. The user can see the list of running apps and can switch to another app.

Upon calling setCurrent(null) the MIDlet will be placed in the
background and the ‘idle’ screen of the device will be
displayed. This enables MIDlets to place themselves in the background.

Interrupting the User

A demo of a user experience focused on ways to interrupt the user when a background MIDlet wants to drive the user’s attention.

-- Background MIDlet calls Display.setCurrent(alert)
-- Background MIDlet tries to access a protected API and a security dialog is prompted.
-- Noteworthy event occurred in the background, e.g., Incoming IM while playing a game.


Managing Resources

The session turned to resource management. In a single-tasking environment, the MIDlet has access to all of the available resources. In a multitasking environment, MIDlets have to compete for available resources

Resource management mechanisms include:

Reservation -- A reservation mechanism sets aside a certain amount of a resource for a MIDlet and keeps it available for that MIDlet and that MIDlet alone

Quota -- A quota mechanism permits a MIDlet to allocate up to a
certain amount of a resource. If the MIDlet attempts to allocate more resources than its quota, the attempt fails, even if resources are actually available on the system.

Revocation -- The system can revoke a resource from a MIDlet and give it to another MIDlet. Resource revocation examples include CPU cycles, display access, and audio playback. Resource revocation doesn’t always have a dramatic effect on
the MIDlet’s execution

The session went on to cover LCD display, and sound issues and offered guidelines for resource policy selection. The key points were:

-- Resource policy definition relies on the underlying platform
capabilities and requirements.

-- A fixed partition policy should be used for fundamental resources that are required by the majority of the applications.

-- An open policy should be used for resources that are used by
specific MIDlets and have limited availability (e.g. Bluetooth, Location).

-- The Display and Sound requires special handling.


Multitasking Safety

Regarding safety, the native JVM task can run native code for any task, hence the code must be made aware of the task on whose behalf it is being called and possibly allocating resources. When the task context is established, the code is considered multitasking safe. Sun’s JWC software is multitasking safe.

The session closed with an exploration of such topics as static and global variables, issues of native code execution, MIDlet guidelines, and basic resource awareness principles.

The take-home message from my perspective is that MVM technology fits nicely with what is happening, for better or worse, not only in youth culture in the US and much of the world, but among older generations. We are living speeded up lives and engage in multi-tasking, out of both necessity and pleasure and we want to be able to do it comfortably and quickly from the same device.

“Dancing while gaming” is here to stay and Sun and Samsung are on to something. More power to them.




Let's Make a Deal: Java and .Net Hold Hands Over Web Services

Posted by hiheiss on May 18, 2006 at 08:08 PM | Permalink | Comments (3)

At JavaOne earlier this week, I took in TS-5540, “Making Java/.Net Technology Based Web Services Interoperability Real” with Sun’s Arun Gupta and Microsoft’s Kirill Gavrylyuk. Sun and Microsoft developers have been meeting at “Plugfests” in Microsoft’s test facilities in Redmond, Washington, where they identify bugs and work to assure interoperability in their web services code. Both have strong customer-driven motivations for removing interoperability barriers between their web services stacks. The collegial environment is reported to have been refreshing and productive. Arun Gupta’s blog has interesting comments:

http://weblogs.java.net/blog/arungupta/archive/2005/11/sun_sleepless_i_1.html

So here were two developers from corporations that once viewed each other as enemies offering a joint presentation. Economic necessity makes strange bedfellows.

Gupta enunciated their basic message: “In this talk, we intend to show you that enterprise web services are real,” said Gupta. “We also intend to show you how web services enable enterprise integration scenarios within and across business boundaries.”

Web services are well adopted on both Java and .Net platforms. Recent developments in Microsoft’s Windows Communication Foundation, which is Microsoft’s web services platform, and the open source Glassfish communities’ compatible app server have made interoperability a reality. They are not just talking about a promising future.

Gavrylyuk and Gupta presented a scenario with a Sun-managed retail quote service which gets quotes from a service running in a homogeneous environment. It gets quotes from a variety of client services, some of which run in a .NET Microsoft environment. It also gets information from a GlassFish client. In both cases they use secure and reliable communication.

They began with consumer integration. Suppose consumers rely on the Sun-managed quote service that uses WCF and Glassfish clients. How to achieve data interoperability? The two managed environments establish what is called a brokered trust relationship through obtaining tokens from STS, Secure Token Service, to authenticate their interactions.

Their presentation next focused on the challenges of integrating both businesses and consumers and the road map for the future. The key issue is establishing a contract through data structures. When it comes to XML schema interoperability, they summed up their advice to developers in the memorable acronym, KISS: Keep Interoperable Schemas Simple. They recommend a simple set of de-facto profiles: xs:sequence, xs:element, wrapped arrays, etc.
There are functional and established complex schemas available and perhaps necessary in scenarios, but Gupta recommended caution in using them.

Schemas should be used as data type descriptions, not as validation mechanisms. Avoid complexity unless it’s required, and avoid schema constructs that do not map well onto programming languages.

They turned to the issue of binary attachments which Gupta acknowledged has had a “bumpy road over the last few years”. xs:base64Binary is interoperable, but comes with a high processing cost and 30% extra message size.

The industry has fallen into two camps: one has gone with SOAP attachments, while the other adopted DIME (Direct Internet Message Encapsulation). Both push the binary data outside of the SOAP envelope. SwA, which is SOAP with attachments, has low interoperability, with attachments outside the SOAP body, and suffers from lack of composition with other web services protocols. DIME has the same problems as SwA.

So what to do? MTOM (Message Transmission Optimization Mechanism) comes to the rescue. MTOM works in a simple manner. It is conceptually like a SOAP envelope, but just before the SOAP envelope hits the wire the binary part of the body is serialized as a separate MIME part.

Integrating Businesses

The key to business integration, not surprisingly, is reliable, secure messaging. With information moving over the web between services, there is a danger of information getting lost and a need for reliable security. Quote service reliability requirements include reliable transfer of messages end-to-end, assurances that orders are not duplicated and secure composition.

They then presented a demo of reliable messaging in which a .NET wholesale service was interacting with a Sun managed Java retail quote service in a reliable and secure manner.
Trust

They turned to the issue of WS-Trust and Security Token Services, which “arbitrate” trust through providing universal token/claim conversion, and support for arbitrary trust patterns in a decentralized manner -- anyone can be STS. They discussed Security Policy and Metadata Exchange whereby
services specify what claims types are required and consumers dynamically obtain tokens through the trust chain.

WCF

Finally, Gavrylyuk discussed Windows Vista Web Services, and the Windows Communication Foundation (WCF -- a.k.a. Indigo) which offers a runtime for building distributed applications. “InfoCards” visualizes a user’s digital identity, Active Directory Federation Services provide an infrastructure for identity and access. Windows Remote Management enables interoperable system management, and something called Web Services For Devices helps with Web Services-based devices interaction.

That's all for now, folks. Bare bones of a technical session but hopefully of some value.

For more meatier or vegy (if you're a vegetarian) details:

Windows Communication Foundation (a.k.a. Indigo)
http://msdn.microsoft.com/webservices/indigo/

GlassFish Community
https://glassfish.dev.java.net/

Web Services Interoperability Portals
http://msdn.microsoft.com/webservices/building/interop
http://mssoapinterop.org/ws/

Web Services Interoperability Blogs
http://pluralsight.com/blogs/kirillg/
http://blogs.msdn.com/dotnetinterop/
http://www.simonguest.com
http://weblogs.java.net/blog/arungupta/
http://weblogs.java.net/blog/haroldcarr/



Putting the Server in Your Pocket

Posted by hiheiss on June 29, 2005 at 11:07 PM | Permalink | Comments (5)

At the June 29, Wednesday morning Platinum session, held from 8:30 to 9:15, Nokia Chief Technology Officer and Senior Vice President Pertti Korhonen provided a vision of the future that promises to take Sun's motto "The network is the computer" to another level, by putting the server in your pocket.

Steve Meloan does a really good job of covering the technical moves Nokia and the industry are making to enable this here:

http://java.sun.com/javaone/sf/sessions/general/nokia_wednesday.j sp

so that allows me to wax philosophical :) in this blog.

It's a remarkable all-too-implicit vision of a world where extraordinary access to information and communicative power are available anytime, any place. Anyone can contact anyone and information about anything is at your fingertips. That is where we are headed. In another year or so mobile Java devices will be in the hands of a billion people, absolutely awesome. The "power of Java everywhere" is no hype; it's fast becoming real. There is no question that in many domains of life, from medicine to meter readers to industry to friendship and love, it's great. But I remember Jon Krakauer's book, Into Thin Air about a disastrous climb of Mt Everest in which many people died. What was almost unbearably poignant was the story of the leader of the climb, an Australian who found himself stranded at the peak in a severe blizzard at which he had the capacity to speak to his wife in Australia by cell phone, but was unable to get down from the summit before freezing to death. Technology could enable this man to talk to his wife as he was dying but it could not overcome the dubious risk-taking judgment that led to disaster.

It's tempting to make this story symbolic of something or other - I don't really know what. Maybe something like the story of the pilot of the plane who doesn't know where he is going but is proud of the fact that he is breaking all speed records. It's all happening so fast, and there is always the law of unintended, unforeseeable consequences.

I found myself wanting Korhonen, and everyone else, to get specific about how this technology can help us. The vision can't just be technological, but one that looks more deeply into the nuances of the implications for human life.

But perhaps that's what the theme of this conference is hinting at with its emphasis on the word, share.

Project Looking Glass: An Expanding Universe on Your Desktop

Posted by hiheiss on June 29, 2005 at 10:31 PM | Permalink | Comments (3)

I'm at TS-7992 where Project Looking Glass (LG3D), a Java technology-based open source project that brings a richer user experience to the desktop through 3D windowing and visualization capabilities, is being presented to an audience of, I guesstimate, 800 people. LG3D sprang from the very creative heart and mind of Sun's Hideya Kawahara. Recognizing that desktops had not changed substantially in 20 years, he set out to make them more aesthetically appealing and powerful. Operating on the assumption that the next user interfaces would be 3D, he initiated a side project that would consume at least two hours a day of his spare time, plus most of his weekends and holidays for more than a year before taking hold at Sun. To put it mildly, it has taken hold. It's the most popular "app" on java.net (http://lg3d.dev.java.net) with 26,600 source code downloads, plus 600 members (and counting) since the 2004 JavaOne Conference where it was open sourced.

So what's the latest? Hideya and Paul Byrne, LG3D project owners, demo'ed a range of 3D images, a music player, scenes in which you could alter the backgrounds with a click, "Alice" an award winning 3D media player (http://alice.dev.java.net) that is the first to utilize the 3D capacity of Looking Glass, and more.

CosmoSchedulerD, a three-dimensional application running on LG3D software, created by developers at the Kyushu Institute of Technology in Japan, won a Duke's Choice Award (http://java.sun.com/javaone/sf/dukes_choice_awards.jsp). As a schedule book, it recreates outer space, with your personal solar system built in by arranging the planets according to their dates. The front of the orbit represents the current time, while the size of the planet symbolizes an appointment's importance, which makes it hard to forget an event even a few light years from now. CosmoSchedulerD contains features that ordinary schedule notebooks don't have, such as automatic scheduling, networking, and a workspace manager. Imaginative desktops seem to inspire even more imaginative apps to be built on them.

(I can't escape the feeling that talking about innovations on a gorgeous 3D desktop is like a donkey carrying a load of books. Have to shake it off. By all means go check out "Philco" running LG3D, the mock-up on the cell phone, and LG3D on a 3D LCD display, and all the rest on the pavilion floor!)

Hideya and Paul gave a brief summary of how to create a "deep" 3D environment. It's built on Java 3D with specialized classes that include a component model, animation system and SceneManager interaction. The LG3D 0.7 release has just arrived. There is now WebStart support (http://lg3d-webstart.dev.java.net) for running the "developers" mode of Looking Glass. It operates in application mode so LG3D can run on top of a user's existing desktop. Java 3D 1.4 now enables performance improvements like shader support. It has Open Solaris support.

In the pipeline is tool integration, a visualization library, and "SwingNode" support. There will be greater inclusion of identity and collaboration features and a more task-oriented UI.

To run it: http://lg3d-webstart.deve.java.net

To get it: http//lg3d-core.dev.java.net

To learn more about LG3D: http://java.sun.com/developer/technicalArticles/javaopensource/plg .html

http://java.sun.com/developer/technicalArticles/J2SE/Desktop/look ingglass/



Shale: The Next Struts?

Posted by hiheiss on June 29, 2005 at 09:57 PM | Permalink | Comments (4)

I'm at TS-7393 along with a pretty packed room of, I estimate, 700+ attendees. All the sessions that I've gone to have been well attended with a serious but enthusiastic-looking group of folks it appears who ask smart questions in the Q & A's. The session is titled "Shale: The Next Struts?" with Sabreware's David Geary and Sun's Craig McClanahan. Craig is Strut's inventor and David, Struts template tag library inventor, which was the inspiration for creating Tiles, one of Struts most popular features. Shale is the new kid on the block in the web application frameworks space, with David and Craig being two of the three leading original contributors on Shale. A lot of people want to know: What's the deal with Struts and JavaServer Faces (JSF), and Struts and Shale? A lot of uncertainty surrounds the topic. It is impossible to predict where it is all headed

McClanahan presents the rationale for Shale. Shale is unique among web application frameworks in that it starts by assuming that JSF exists. Recognizing that with a little tweaking you can turn JSF into a completely functional web app framework, he decided to see if something as popular as Struts could be created. So he proposed Shale as the architecture for Struts 2.0 to Struts developers, which did not entirely sit well, given the focus on backwards compatibility and support for existing Struts users. They did accept Shale as a Struts sub-project, so it is officially part of the Struts environment. The idea is to grow a community around Shale that is already used to the idea of using web app frameworks in developing. He is quick to point out that Shale has zero direct relationship with the Struts 1.0 code. Shale is all new code based on the assumption that JSF exists; it skips the step of re- implementing the features that are already there, like validation and request processing.

Features in Shale include web flow, so developers can organize a dialogue that is longer than a request but shorter than a session. There is client-side and server-side validation but with JSF components. Shale is integrated with Spring to enable transparent use of Spring's bean factory to create managed beans. David Geary has been extracting Tiles out of the Struts core, so it is independent of the underlying framework and can be used by any framework more easily. Shale will take advantage of that. Primary subtrees is another way to perform reuse that will function through a specialized library called "Play". McClanahan pointed out that a lot of people dislike Struts because it likes JavaServer Pages (JSP). JSF likes JSP as well, but JSF has components as a Java API, and developers can plug in a different view handler to use something different. With Shale, they've created an environment that looks like Tapestry with a standard HTML file for the markup presentation. It has a test framework to make it easy to test the view controller and other implementations.

He is quick to point out that, although they could use Shale to create another JSF component library, that is not their goal. The components they are creating are only ones that interact directly with the framework's facilities. Anyone's JSF components will work in Shale - why reinvent the wheel? The five tags within Shale are: token tags to catch duplicate submits; a subview for extra value-add services for a dynamically included page as well as the main page; a commonsValidator tag used to integrate the commonsValidator rules; a validator script so developers can point to the Java script so they don't have to load it on every page. and a clay tag used for parameterized subtrees.

JSF as an architecture has extension points that Shale takes advantage of. The Spring integration is a custom variable resolver and looks at the first word in an expression like "customeraddress.city" -- if a customer does not exist will create the bean for you. By default, JSF will look in the managed beans definitions, but the extension checks for a bean factory as well. Similar facilities enable access to the Java Naming and Directory Interface (JNDI) context. The navigation management is encapsulated in a specialized dialog navigation handler. A specialized view handler enables developers to treat a Tile name as a view ID to reduce work

So where is all this headed? McClanahan presents three scenarios. First, it is possible that Struts developers will see that Shale is becoming popular and choose it as Struts 2.0. Second, it could become a separate Apache project - synergy exists with the Apache MyFaces community that is building both an implementation of JSF and some interesting components to go with it. All of the JSF-related things could be encapsulated into a single project. A third possible future is aware of how long it takes to build a Java standard in the Java Community Process (JCP) - almost two years to build JSF 1.0. Shale can be seen as an experiment to see if its facilities make sense in a future JSF release, perhaps in JSF 2.0 time frame. The future is unclear and ultimately in the hands of developers.

An Interview with Craig McClanahan

http://java.sun.com/developer/technicalArticles/Interviews/jsf_mc Clanahan.html

David Geary's Blog

http://jroller.com/page/dgeary

Craig McClanahan's Blog

http://blogs.sun.com/roller/page/craigmcc

A Pragmatic Application of SOA (Service-Oriented Architecture)

Posted by hiheiss on June 29, 2005 at 10:06 AM | Permalink | Comments (1)

Over at TS-1640 Pragmatic SOA: A Case Study, with developers Ashok Mollin, Ashesh Badani of Sun Microsystems, Inc. and T.N. Subramaniam, Director of Technology at RouteOne LLC Inc. Ed Ort (http://weblogs.java.net/blog/edort/archive/2005/06/pragmatic_soa.html) and Tim Bray (http://www.tbray.org/ongoing/) of Sun are blogging the session in greater detail. I will be doing a story on this for java.sun.com in a month or two so stay tuned. For now, a sneak preview.

RouteOne provides a web-based Credit Aggregation Management System (CAMS) created to accelerate the automotive finance process for dealers and their finance sources. The session presented “a real-world implementation of an SOA project at RouteOne LLC and helps explain the architecture and various best practices, design patterns, standards, and technologies involved in building an end-to-end business solution.” The presenters define Service Oriented Architecture (SOA) as “an integrated software infrastructure and design approach, leveraging Web computing standards, for delivering business functions as shared and reusable services.”

A lot of people regard SOA as a real challenge, in part because it typically involves both substantial organizational change, in addition to new ways of organizing IT. It seems like a situation in which developers have to be, not only technically sharp, but good listeners who can understand the culture of the company they are working with. Creating a shared service requires technical design prowess — architects have to know who, when, and where in the business process, services will be consumed. And then there is the whole history of ERP enterprise resource planning, in which some CIOs and IT managers experienced a lot of growing pain involving expensive projects that required changing processes across the enterprise as part of automation. It has not always worked out. Some people fear that SOA will bring a lot of pain to companies because it may be bigger than an ERP implementation. So businesses are sometimes understandably cautious. There can be a lot to rethink: development methodology, business impact, infrastructure, budget, organizational design and more.

Another challenge involves creating high-level business components that can be re-used and re-configured. One problem is that the requirements that yielded the original component interface were different enough from the new ones so that they required the re-write of substantial functionality.

The basic approach of Sun’s Ashok Mollin and Ashesh Badani, along with RouteOne’s T.N. Subramaniam, seems sensible and cautious: Projects need to generate ROI in 12-18 months so start small and be opportunistic. Minimize disruption to existing infrastructure; reduce risk with fewer web services initially while climbing the skill curve. Wrap legacy/existing applications using adapters + WS; Java and .NET interoperability. Evolve into a flexible, standardized architecture; does not mean “rip and replace”. Foster cultural change to encourage reuse. Take a top down approach – let the business drive!

They addressed several critical problems:

Single Sign On

Transparent login from lender portal

Get Dealer Information

Accessing volatile dealer information at runtime

Import Credit Application

Start the process on another system – DSP

Orchestration

Maintain state and coordinate document exchange in long running transactions with Lender

A summary of their “Pragmatic SOA wisdom:

Start simple, don’t let the “alphabet SOAup” overwhelm you.

Let business identify the service.

Think XML documents not objects.

Use SOAP as an envelope, but not for binding.

Use WDSL 2.0 for description not code generation.

Think asynchronous conversations.

Use WSBPEL to orchestrate the process.

Use JBI for integration.

Keep learning, this is not finished.

Question as I left: Did the large Java developer audience there come away enthusiastic about SOA? There certainly were a lot of smart, probing questions in the brief, casual q &a after this session, if that's any sign.





Powered by
Movable Type 3.01D
 Feed java.net RSS Feeds