Java is a high-level, platform-independent, object-oriented programming language originally developed by Sun Microsystems. Java is currently owned by Oracle, which purchased Sun in 2010.

learn more… | top users | synonyms

3
votes
0answers
650 views

Passing a Context around with dependency injection

In the project I'm working on, I'm using Guice and trying to do as much as possible with Dependency Injection. However, there's one little snag; many of my objects rely on an object Context. This is ...
3
votes
0answers
320 views

Fluent interface implementation and reflection. Case study

I hope I picked the right group for this question... I have this little framework I want to implement and I would like to have an opinion on it. In particular I am more concerned about the ...
2
votes
0answers
238 views

Is it safe to convert Windows file paths to Unix file paths with a simple replace?

So for example say I had it so that all of my files will be transferred from a windows machine to a unix machine as such: C:\test\myFile.txt to {somewhere}/test/myFile.txt (drive letter is irrelevant ...
2
votes
0answers
73 views

How can I make a universal construction more efficient?

A "universal construction" is a wrapper class for a sequential object that enables it to be linearized (a strong consistency condition for concurrent objects). For instance, here's an adapted ...
2
votes
0answers
262 views

Design thoughts on a schema based request object for CXF endpoint

Trying to seek design suggestion on a schema based request object for a CXF endpoint. I've created a CXF SOAP endpoint which takes the following object as an input. The request object will have ...
1
vote
0answers
118 views

Should we encapsulate everything in a try{} block in a Try object?

Why can't I make a class for a Try including what I try and then run that in the try {} block? Why is it impractical? class DBConnectTry extends Try { TryResponse response[] attempt(TryObject ...
1
vote
0answers
72 views

Using streams as method parameters and/or return types

So let's say I have a 'Transformer' interface that can transform one file-type to another. Let's say I also wish to use streams to provide the data to the Transformer. Which is the approach that is ...
1
vote
0answers
116 views

Benefits of EJBs over POJOs for Jersey JAX-RS Resources

I'm writing a Jersey 1.9 JAX-RS application. I have to use 1.9 because it's the only supported version. I'm trying to decide if there is any benefit to using EJBs as my Jersey Resources, rather than ...
1
vote
0answers
360 views

Thoughts on refactoring a generic DAO

I have designed a generic DAO in Java and am having confusion about whether to refactor it to different design or not. PS Don't say to use already existing 3rd person framework. I know there are some ...
1
vote
0answers
427 views

Java UDP Multithread Server

I have multiple threads. Each thread receives data and sends to client an acknowledge packet. Each thread takes aprox. 531ms from start to finish. While capturing packets with wireshark. I was ...
1
vote
0answers
174 views

Refactoring Tomcat webapp deployments

Background We have several webapps running on Tomcat 7.0.x (on Linux). For historical reasons, we have populated the "Common" lib (i.e. $CATALINA_HOME/lib) with many application jars. These jars ...
1
vote
0answers
157 views

How to render graphical interface automatically (behind the scenes)

I am trying to write a program that shows images of a Java application's GUI automatically (ie, without someone building, running, and then taking screenshots of the interface). I know WindowBuilder ...
1
vote
0answers
177 views

Single write, multiple read of stateful objects

Scenario: One data input feed (call this Source) Multiple objects (call these Layer1) read this Source, and analyze the feed. This analysis is stateful. Layer1 objects have configuration parameters. ...
0
votes
0answers
25 views

Remote limitations of hg4j?

I’m evaluating hg4j to see if it’s useable in my current project. I need a (preferably) pure Java hg library that can: Check out a working copy of a remote hg repo at, say, ...
0
votes
0answers
77 views

How to design extension mechanism for java app

I have an application where I have a set of core features. The application itself HAS to work in core only mode. I would also want to make the application extensible such that, when certain ...
0
votes
0answers
89 views

How to convert a Java applet into a runnable jar?

I am a complete beginner to programming but I have managed to create a game as a Java applet. Can an applet be converted into a runnable jar file? If so, how ? Is there another way I can make my ...
0
votes
0answers
48 views

Dynamically add/remove components to/from panel

I'm in a little planning phase of my java/swing project. Here is a picture: It is a main panel containing several sub panels depending on the selected date in the top center. I want to browse those ...
0
votes
0answers
13 views

How to get Datasource JNDI access to work with WebLogic reliably (no NameNotFoundException)?

in a WebLogic web application (bundled and deployed as a Jar) I sometimes get a NameNotFoundException when I try to fetch a datasource using JNDI lookup. The datasource is not shown in the JNDI tree ...
0
votes
0answers
53 views

Android From Local DB (DAO) to Server sync (JSON) - Design issue

I sync data between my local DB and a Server. I'm looking for the cleanest way to modelise all of this. I have a com.something.db package That contains a Data Helper and couple of DAO classes that ...
0
votes
0answers
36 views

Access Token Verification

I have spent quite a few days reading up on Oauth and token based security measures for REST API's and I am currently looking at implementing an Oauth based authentication approach almost exactly like ...
0
votes
0answers
205 views

Multidimensional multiple-choice knapsack problem: find a feasible solution

My assignment is to use local search heuristics to solve the Multidimensional multiple-choice knapsack problem, but to do so I first need to find a feasible solution to start with. Here is an example ...
0
votes
0answers
27 views

Declarative Transactions in Node.js

Back in the day, it was common to manage database transactions in Java by writing code that did it. Something like this: Transaction tx = session.startTransaction(); ... try { tx.commit(); } catch ...
0
votes
0answers
59 views

Appropriate design / technologies to handle dynamic string formatting?

recently I was tasked with implementing a way of adding support for versioning of hardware packet specifications to one of our libraries. First a bit of information about the project. We have a ...
0
votes
0answers
40 views

A 'task' system which has an ending, to get ready for next task

I want to make a system, so that there are certain tasks. For example, let's talk about a game. I want to make it so there are 100+ tasks doing different things, but when the player's magic level is ...
0
votes
0answers
39 views

URL and Controller structure for parent-child-relationship

I use an MVC web framework to create an application which contains a hierarchy: Location <1-N> Devices <N-M> Services I have a number of Locations. Each Locations can have several ...
0
votes
0answers
169 views

Spring bean injection into a hibernate validator constraint

I have a controller method like listed below whose argument is annotated with @Valid to validate PasswordChange object using a Hibernate validator @Constraint. Both PasswordChange and a sample ...
0
votes
0answers
39 views

Specific class to pass a bundle of data from my Model to Controller or a simple Collection?

I am doing an Invoice application implementing MVC pattern design in Java. One of the features my application has to have is showing all info about a Customer: Personal data, Calls, Invoices, ...
0
votes
0answers
84 views

2D Game Data Structure in OpenGL ES 2.0

I'm trying to come up with some data structures for rendering my map on OpenGL. It is going to be ~ 100x100 blocks(squares) total, with each block being around 100 pixels. However, the screen will ...
0
votes
0answers
50 views

Suggestion to Design API Centric Application using Appengine

I have been planning to create an new application. So I was designing the application structure.i know this application will be accessed form multiple devices and the app feature will be increased. ...
0
votes
0answers
49 views

how to separate the logic of different views when using android viewFlipper?

I use a ViewFlipper in a dialog. I want to fetch the data from the EditText in both of them and also add click listeners to both of them. I can write the whole code in one big file, but i want to ...
0
votes
0answers
64 views

Rich console UI

There are bunch of console programs and especially games using full redraw (not sure ho this correctly named) of console window. For example, look at output of linux top program -> ...
0
votes
0answers
55 views

How to manage data flow between UI components?

I have been trying to use classes that implement ActionListener to respond to user input. I'm consistently noticing that for an action listener to communicate the event to other objects, it has to ...
0
votes
0answers
80 views

Algorithm / working approach to get a random list of data

I am working on a android schedule app but that isn't matter , the problem is a algorithm / methodology so you are welcome to just write the pusedo code to answer. The data is like this Place ...
0
votes
0answers
268 views

Make a java program use more processors

I am running a program that is supposed to solve a problem with the brute force approach. My computer has a quad-core CPU. When I run the program clearly java uses only one core, because in my ...
0
votes
0answers
24 views

Is there a good idiom for handling an in-line startActivityForResult

I have a bunch of Java code that looks something like this. //Global boolean something_result; Monitor something_monitor; // Some class on worker thread Intent intent = new ...
0
votes
0answers
78 views

Succinct Lazy Initialization Pattern

Background I often use the following lazy initialization pattern: public class Clazz { private Object object; private Object getObject() { Object object = this.object; if( object == ...
0
votes
0answers
49 views

delegate classes for UI events

When designing a delegate to represent the state of a UI (java swing) what is cleaner: to manipulate the delegate directly from the custom event handlers defined in the UI code, or to register the ...
0
votes
0answers
113 views

How to move away from hardcoded paths in our build processes

We have a set of Java tools that are built and run locally. Whenever one of the devs commits a change, everyone else (including non-developers) need to do an update and build the tools. Everyone uses ...
0
votes
0answers
26 views

How would I handle a set of differing event classes with differing handler interfaces in a single event processor?

I'm working on an event processor framework for a simple game I'm writing, in which multiple types of events are handled in a loop. Since these events carry distinct pieces of data (i.e. one carries a ...
0
votes
0answers
77 views

Whats the best way to parallel my problem using Java API

I´m with trouble, because I want to make faster my code using threads, fork in join or any kind of parallel. I did a code using fork in join but I saw my arraylist isn´t getting the correct values. ...
0
votes
0answers
145 views

Problem combining SlidingMenu and ExpandableListView

As said i'm trying to combine SlidingMenu (https://github.com/jfeinstein10/SlidingMenu) with an ExpandableListView, but i'm having an issue that i don't know how to fix, so i'm hoping some one here ...
0
votes
0answers
137 views

Parsing Razor-style Templates

I want to build a template engine (ITT not another template engine...) based on Razor. I've been at it for quite a long time not getting anywhere and quite frankly I'm at my limit. I've tried rolling ...
0
votes
0answers
201 views

Generic/Dynamic objects in JSF

I'm starting to learn JSF and I was wondering how could I implement the following: I have an instance of Spring that contains several beans for logical and database operations, for example I have a ...
0
votes
0answers
67 views

Use of raw types in Java XML-RPC

I have been investigating the implementation of XML-RPC in Java. The major open-source libraries (e.g. Apache XML-RPC) use raw types to represent certain XML-RPC types in Java, e.g. structs are ...
0
votes
0answers
96 views

is there an order for resource bundle loading / searching sequence in java

just for a trial, I generate two ResourceBundle, one is a property file MyResourceBundle.properties and the other one is MyResourceBundle.java in the same directory.When I tried to get a key with this ...
0
votes
0answers
231 views

Architecture design with MyBatis mappers

I am creating rest web service for providing data. I am using Spring MVC for handling rest requests, and MyBatis for data access. Application should be designed in the way that it should be easy to ...
0
votes
0answers
33 views

Why EJBContainer has no methods for managing transactions and other EJB low level services

I read that the EJBContainer is responsible for things like managing transactions, managing EJB lifecycle, managing bean pools etc. So I took a look at the source code But there seem to be no methods ...
0
votes
0answers
34 views

Transparant OSGi support in modules

I have a bunch of libraries and I have started exposing them as OSGi modules. However there were two requirements: no new dependencies the modules still had to run in non-OSGi environments The ...
0
votes
0answers
112 views

Portlets (and portals) vs usual webapps

I am working on a big project containing (among others) two web applications: one is implemented with Spring MVC and the other is meant to be implemented using Web Experience Factory (portlets). One ...
0
votes
0answers
81 views

Recaching calculations

I'm working on a webapp which has an existing framework to cache values from the database. I have a requirement which needs multiple values from the database and the values have to be ...