Monitor a Java Native Interface applications - azure

Question: How to monitor a Java Native Interface applications; do we use a Java Agent or the VM Agent?
Based on my research I believe its via the Java agent but need a SME to confirm this is the recommended approach or point me in the right direction.

Related

EtherCat module :How to communicate with linux

I'am going to communicate EtherCAT master(CX2020) with Linux OS PC(ubuntu) for storing value from PLC on server and writing also.
By EthearCAT network protcol, it should be availave to communicate with windows plc installed twincat.
But I couldn't find the way for Linux.
Is there any solution?
There are various ways for you to communicate with a CX2020 from Linux, it all depends on your requirements and what the usage is for.
Without knowing anything about those, one option is to use the Beckhoff ADS protocol. All Beckhoff PLCs have by default ADS installed on them and you can
(with the right credentials setup for ADS) communicate with the ADS-library. The good thing about ADS is that it is open-source, and thus it's possible to
get the code for Linux.
The ADS sourcecode is available at:
https://github.com/Beckhoff/ADS
You basically need to:
Compile/Install the library on your Linux machine
Create an ADS/AMS-route to your CX2020
Create a program that uses this route to communicate with the PLC
With ADS you can access the variables directly in the CX2020 memory (both read and write!).
There are many finished wrapper libraries available for all common programming languages that you can use directly in Linux. If you're up to Python, I would
recommend checking out PyADS (https://github.com/stlehmann/pyads), which has a good user base and many examples available all around the net.

Server and client side programming language and frameworks to use in embedded systems

I am going to implement an easy-to-use and eye-catching graphical user interface for management and configuration of an ethernet switch which has a flash (of just 16 MB) mounted in it, which will have an embedded linux, some specialized softwares, CLI and GUI.
I think, I should go for a web-based graphical user interface so that an admin can access it using the switch's IP. At client side I am thinking of using HTML5 or HTML4 with Javascript as GUI developed in Flex will probably take much more flash space.
However, I don't have a clear idea of server side technology to be used. Should I go for mini-apache for embedded systems with PHP (as I am familiar with Apache+PHP on x86 systems)? or is there a better alternative?
Also, should I go for a MVC type of architecture? Are there some great MVC frameworks developed for embedded systems?
Update:
Basically, I only need to provide a GUI on top of a CLI running on switch. Basic workflow of the application will be something like:
User access GUI through a web interface
User performs an action on GUI
A CLI command corresponding to the action performed is sent to the
server (running on switch)
Server runs the CLI command on the switch
Server returns result of the command back to GUI
You could use an HTTP server library like Onion (in C), GNU libmicrohttpd (in C), or Wt (in C++) to make your own specialized HTTP server (embedded inside your device).
You could also use Ocsigen in Ocaml for the same purpose.
I don't think that embarking a complete HTTP server (apache, or perhaps better lighttpd) with a PHP stack makes real sense on an embedded device (the code stack would be much bigger). On such a device the performance does not matter much (you won't get thousands of HTTP requests per second), but the code space (and process space, ie memory consumption) is quite important. (And the specialized web server solution I am suggesting uses only compiled code, which would run faster than interpreted PHP).
If you insist on having a lighttpd or apache web server in your device -which I believe is wrong-, you could make your application a FastCGI application (and code it in C, C++, Ocaml, ...).
As Simon Richter commented, you could consider making it (also) an SNMP service.

is there Windows services on winCE?

is there something like Windows Services for WinCE 6.0 OS?, I mean, a background process thread(s) doing their things...
I need to develop a programm on .NETCF thay always listens to a specific port on device, stores it on SQL Server compact database and sends it back to another port. Don't want to do a desktop app for this as there will be no GUI at all...
Yes, Windows CE supports Services. However a true service must be written in C because the CF doesn't support EE Hosting. There is a Codeplex project to try to make managed services. I've never used it so I can't say I recommend it or not. YMMV.
As far as writing an app with no UI, that doesn't require a service. Just don't create a Form in your Main method.

Listening a particular port on linux to access data comes from mobile device

i am newbie to Linux platform, i am working on java technology.
what i have to do is : Having a program that running on mobile devices,that sends some data to my Linux machine, now i have to create a program in java that
listen to a particular port.
access data comes on that port(which is sending by mobile device)
save that data to the database.
response back to the mobile device.
i.e. i would make my Linux system as server that can listen from many clients(mobile devices), but not getting how to configure this environment... :(
i used cent OS 5.4 and
installed jdk1.6.0_24
any help would be appreciated.....
thanx in advance!
khushi
One of Java's greatest strengths is that you can pretty much ignore the host operating system as long as you stick to core Java features. In the case you're describing, you should be able to accomplish everything by simply using the standard Java networking APIs and either the JDBC to access an existing, external database or you could choose any number of embedded Java databases such as Derby. For your stated use case, that you'll be running the application on Linux is pretty much irrelevant (which should be good news... you don't need to learn a whole operating system in addition to writing your app ;-).
Here's a nice client/server tutorial, in that it is broken into steps, and adds each new concept in another step.
Here's another client/server tutorial with much more detail.
I would write it to accept one connection at a time. Once that works, I would study the new(ish) java.lang.concurrent classes, in particular the ExecutorService, as a way of managing the worker bee handling each connection. Then change your program to handle multiple connections using those classes. Breaking it up in two steps like that will be a lot easier.

J2ME development and native API

Is it possible to write a mobile application with J2ME and whenever we want to implement a functionality not offered by J2ME call native mobile API ? (kind of like what is done with .NET, whenever you need something not provided, you just call the Win32 API from the .NET platform).
While JNI is not officially supported in J2ME, the Symbian implementation of J2ME obviously uses something very similar.
Since most J2ME APIs have a corresponding Symbian OS C++ API, what Symbian did (a lot) is develop adaptation layers between the 2.
Between that and the new modular architecture of the IBM J9 virtual machine (from Series60 3rd edition feature pack 2 onward), it is technically possible to add a new API to the virtual machine without actually needing to recompile most of a handset firmware.
However, third party developers simply are not allowed to do it without a lot of help from the handset manufacturer.
A loopback socket connection is the solution that people have tipically implemented to transfer data accross the language barrier. Large-scale deployment is not the easiest task, though, as you technically need to install 2 applications on the device. Once you understand the threading model of the Symbian J2ME implementation, you also realize how ugly and inefficient a hack it is.
When you reach that kind of issue, it's time to learn Symbian OS C++ and do it right.
No. That's not possible with Java ME.
Only sort of. Actually it is possible but not directly. You can write a native server that listens on a local socket and send requests to it from your Java MIDlet. Someone even released a framework to do this called MIDP-JNI (as opposed to real JNI). Obviously the form of the solution imposes some limitations on what you can do with it but it isn't actually impossible.
Be aware that using this approach can make your application much more complex to debug.
If you are specifically looking out for Nokia/Symbian, then APIBridge http://wiki.forum.nokia.com/index.php/J2ME_API_Bridge_Interface could be a solution. Typically it is the 'official' version of 'native server on local socket' kind of thing. The APIBridge is 'extensible' & you can write your own 'plugins' for your suitable 'low-level' task.

Resources