Help me with some question about Worker/Service/Task in JavaFx 2

I have read some articles in the forum adout mutithreading in JavaFx2, and now I know if I want to do some long-run jobs, i should use Service/Task.
But my application needs a function like this:
1. here is a long-run job(something like getting data from database or other resources);
2. If I clicked a button, then the job started and get the data.
3. When the job is done, I show the data in the tableview of my JavaFx application.
4. then the job waiting some random time(such as 100 seconds).
5. then the job started again automaticlly.
so, the steps are 2->3->4->5->3->4->5->3->4->5->........
so, the important things is that the job runs many times automaticlly.
I know I should implements the job as a Service or Task in javaFx, But where should I put my "while(true){ job.start();sleep(random_time);}" loop code to make the job start automaticlly after some random sleep time.
I wonder what is the best practice for this use case.
My english is poor, but i hope you can understand what i'm dealing with.
Thank you very much!
Edited by: user9529194 on 2011-12-18 下午8:20

Hi,
Based on the response from John,
I think you can acheive the functionality as below.
// Creating the tableview.
TableView<Person> personTable = new TableView<Person>()
// Instantiating the personlist.
ObservableList<Person> persons = FXCollections.observableArrayList();
// Setting the list to the table.
personTable .setItems(persons)
final Button button = new Button("Refresh");
final Timeline repeatTimeLine = new Timeline(
      new KeyFrame(Duration.seconds(100), new EventHandler<ActionEvent>() {
            @Override
         public void handle(ActionEvent event) {
                // Call the service method to update the list.
                   PersonService.updatepersons(persons );
button.setOnAction(new EventHandler<ActionEvent>() {
     @Override
     public void handle(ActionEvent arg0) {
             repeatTimeLine.setCycleCount(Timeline.INDEFINITE);
             repeatTimeLine.play();
});And in the Service class...
public void updatepersons(final ObservableList<Person> persons){
          final Task<List<Person>> getPersonTask = new Task<List<Person>>() {
          @Override
          protected List<Person> call() throws Exception {
               return getPersonService().getPersons();
     getPersonTask .stateProperty().addListener(new ChangeListener<State>() {
          @Override
          public void changed(ObservableValue<? extends State> arg0, State arg1, State newState) {
               switch (newState) {
               case SUCCEEDED:
                    persons.clear();
                    persons.addAll(getPersonTask .getValue());
                    break;
               case FAILED:
                    break;
     ThreadManager.getInstance().schedule(this.getClass(), getPersonTask );
}I hope this code can give you some idea.
Happy Coding !! :)

Similar Messages

  • HELP NEEDED WITH SOME QUESTIONS

    Could ye guys help, I have some questions and I dont know the answers of them! any solutions would be great
    Distinguish between composition and inheritance as used in object-oriented programming. As part of your answer, provide examples of different situations in which each would be more appropriate.
    What is meant by recursion as an algorithmic strategy in working with abstract data structures, and why is such an approach considered worthwhile? Illustrate your answer with an example sorting algorithm in Java that can be sorted linearly and recursively.
    Given an alphabet of {x,y,z} possessing the following frequency distributions {1/8, 1/4, 5/8}, show how this information may be used to construct a prefix code binary tree. Given the code 11000111100, show how this is decoded using this construct.
    Any ideas??

    086kerry wrote:
    lad if you had seen what I had to do already, its not as if I want the answers, just help. I cant find anything satisfactory on the web.Not to quick are ye?
    If you can't do more than post your assignment and cry for help then you might as well give up now. Nobody is going to do your work for you. You have done NOTHING yet so start working on it and if you run into problems come back with your code and ask questions about it.

  • Please help  me with some questions with batch input session?

    hello everyone.
      I come to some questions  like
    1 What is a batch input session ,
    2  What is the alternative to batch input session?
    3  An ABAP program creates a batch input session.   We need to submit the program and the batch session in back ground. How to do it? 
       would you please help me with the questions, couldn't thank you more.
       Best regards
                                                                          Frank

    Hi
    Batch Input Session:
    BATCH INPUT SESSION is an intermediate step between internal table
    and database table. Data along with the action is stored in session
    ie data for screen fields, to which screen it is passed, program
    name behind it, and how next screen is processed.
    Three processing modes of executing Batch Input Session :-
    Run Visibly : You can correct faulty transactions online & work step-by-step through  the transactions not yet executed.
    Display Errors only : You can correct faulty transactions online.   Transactions not yet executed, but without error, run in the background.
    Run in Background .
    2) What is the alternative to batch input session?
    Call transaction.
    3) An ABAP program creates a batch input session. We need to submit the program and the batch session in back ground. How to do it?
    go to SM36 and create background job by giving
         job name,job class and job steps (JOB SCHEDULING)

  • Potential new T61 user with some questions about product/su​pport/etc.

    Hi all!
    I've been using Dell Latitude's for last 7+ years and been happy with them thus far, as I was able to stay within the C-series thru 3 systems and reuse some components such as batteries, CD-ROM, etc. but now that I'd have to go to D-series, that gives me the choice of going to new vendor...and IBM/Lenovo was the only other choice due to my OS requirement: XP Pro!
    So now I'm here asking some questions that I'm still having issues with:
    (I'm comparing the T61 to Dell D530 and/or my C610)
    1) Features that I've used on existing Dell that I don't see on T61 :
        a) Infared port --- I've used to transfer stuff from one sys to another
        b) S-Video out --- I've used to display on TV for some situations  
        c) Serial port --- can't recall using it but with my luck, I'd need it sometime. 
        d) Parallel port (C610) --- for my really old printer used on rare occasions
        e) Floppy drive --- yes, I still use it for some unusual situations
    2) On Dell, I can put a 2nd battery or floppy drive in the media bay instead of CD/DVD...what about T61?
    3) Support:
        a) Dell forums have 7+ yrs of history and are well used...this forum seems brand new...was there another one before it?
        b) My Dell's have lifetime tech support (ok, so sometimes understanding the folks from India can be an issue) but IBM seems to limit this to life of warranty.
    4) Pricing: T61 would be seem to be, at minimum, about $150 more than similar Dell even with current "sales"...I'm having trouble justifying this...
    5) Things that I see that T61 has that new Dell D530 doesn't:
       a)  built-in mike --- my current Dell has it and I use it now and then so this is a plus!
       b) keyboard light --- nice feature, but couldn't I use a USB one instead if I really needed it?
       c) fingerprint reader --- never used one...how often do people use it?
       d) 2nd card slot for Express cards --- current Dell has two standard slots and I'm using both, though one is wi-fi which C610 didn't have built-in...and other is modem to replace failed built-in...D530 has only one slot, so having 2nd of any type is good.
       e) middle mouse button --- is that what I'm seeing? Or is it something else?
       f) recovery partition --- ok, nice but how much room does it take?
    6) Things that D530 has that T61 doesn't:
       a) 4th USB --- I'm used to only 1 now so even 3 would be big step up...
       b) 15" standard screen --- T61 is only a 14.1" screen and that extra bit of size would likely help, but I'm limited on physical dimensions to 13.5" total width (unusual situation) so a 15.4" wide screen isn't possible...I'm looking at SXGA+ in either case to maximize usage.
       c) recovery CD is standard --- so I'm presuming I'd have to create my own here?
    That, I think, about does it...so...any users willing to help me decide if a switch is good for me?
    Thanks!!!
    Update: It seems that phone tech support is only available for warranty period with IBM, whereas with Dell, I can still call for hardware tech help (to diagnose problem at least) for "lifetime" or well past paid period, as I've already done in past...comments?
    Update #2: Changed the incorrect "R"s to "T"! Duh!
    Message Edited by J_Hallgren on 12-28-2007 07:50 PM
    A current Dell Latitute user who was looking to maybe switch...But didn't.

    I finally made the switch to Lenovo and the Thinkpad line of notebooks and think this was the best move I have ever made in years! I've spent far too much money maintaining a separate notebook (Dell Latitude L400) several custom built desktops.  This December, I sold my desktops, my laptops (I had 2 L400's), and my 20" Aquous LCD TV to finance my Thinkpad T61.  It was well worth it!  I will try to answer your questions in this checklist, which I found to be quite similar to my own .... frighteningly exactly like my own....:
    Hardware Requirements
    IR: This is pretty outdated but functional.  I used to use a Palm with IR as well as an IR laser printer.  I ditched both for a PDA phone with bluetooth.  The laser printer is networked now
    S-Video: You might be able to get away with a TV tuner cardbus or a expres card.  There might also be external converters that convert from your VGA/DVI (DVI via port replicator) into any variety of video outputs.
    Serial: My older Palm had a serial port for the docking station - bluetooth is a good replacement
    Parallel port: I currently have a USB to parallel adapter in my bag just in case.  These are cheap cables and work well.
    Floppy: I keep a USB one of these just in case.  I find that having fewer input devices on my laptop and leaving them external help keep the machine lighter for my mostly mobile usage (e.g., my L400 with no inputs at all except 1 USB port).
    T61 Spare Battery: Uses ultrabay battery - I rarely use the DVDRW drive and leave the ultrabay battery in there while on the go.  DVDRW drive stays in the bag until needed.  I recommend you upgrade to the 9 cell battery with the advanced ultra bay battery, which will give u something like 9 to 12 hours of operating life.  If you are not a fan of the battery pack sticking out like crazy, stick to the letter box format laptop (not widescreen), which will provide the minimum amount of battery pack stick-out with the 9 cell battery.  The 6 cell will not stick out with the letterbox laptop but will stick out with the widescreen version.
    Support Options:  I rarely call support so I have no opinion here.
    Pricing: Price was not really a concern for me.  I purchased mine for the business look mainly, which Lenovo maintained well.  I don't like the shiny/plastic/toy look of Dell and Apple computers these days.  If anything, consider the premium an investment in the build quality of these machines (or a premium just for the good looks).  I particularly like the roll cage as well as active protection system that stops the hard drive as soon as the system detects excessive motion. 
    Included Hardware Comparison:
    I like the mic, use it often for Skype and the built in 1.3MP webcam as well. 
    Keyboard light.... kinda cute but not as functional because it simply is too small.  It was a cute idea that could have been made better had Lenovo opted for a backlit keyboard instead.  That would have been more functional and added to the "cool" factor. 
    With regards to the Express Card and PCMCIA card slot, I rarely use either because everything is built in.  However, if you want that TV tuner, an express card or PCMCIA card slot is good.  If you opt for the built in media reader, you will be unable to use the express card as the media reader takes up that slot (I might be wrong, but I think the card reader is large enough that it takes up both slots, so u can't add anything anyway - but you should call pre-sales to answer that question). 
    Middle mouse button: The three buttons in the middle are used for the trackpoint/joystick mouse controller.  I think the middle button is configurable to do various things.  I personally hate the joystick and can only use the touchpad.  The lack of a touchpad was the only reason I did not stick to the smaller 12.1" X line of laptops, which was really more in tune with my size requirements (too used to using the L400 sized machine).
    Recovery Partition: This is a cheap way for manufacturers to make it easy for people to recover their systems in case of crash - without the need for any documentation or disc media.  However, it makes it hard for people like me who only use machines after a clean format and customized install of Windows.  This partition is about 10GB and can be erased with special disk format or partition tools.  Windows itself cannot read or delete this partition.  With the minimum size of the hard drives available, this should not be an excessive space killer for most people.  I personally need only 7GB total for OS and apps.  The remaining data I work with is actually streamed from a 500GB gigabit NAS.  I might switch to a 32GB solid state disk one of these days when their performance comes more in par or exceeds traditional drives.
    Recovery CD: You can create your own from the recovery partition since Lenovo does not provide any.
    4th USB: I only use 1 or 2 as well.  1 for an external micro mouse (I love my touchpad, but it's just hard to use with Photoshop or CAD apps) and a second for a USB memory key.  My other devices i.e., scanner, external mouse, keyboard, are plugged in on my desktop through a USB hub that goes to a single port on my docking station.  So yes, your docking station will probably remove the need for more than 2 ports.  Although, I do find it odd there are only 3 ports... such an odd number.
    Screen Size: I personally wish I could have gotten the X series of laptops but the 14.1 was the only other mobile solution.  For the larger screen size, docking station to my 24" Dell 2405FP.  The compact nature of the T series makes it pretty thin and compact though... it was not too much bigger than my L400 - at least, not uncomfortably bigger.
    But yeah, I think if you make the switch, you'll be getting yourself a solid machine that will keep u going for years.  The Latitude line of Dell's were really good, but overall, I feel that the nature of Dell's manufacturing process is making it too "cookie cutter" and reducing its overall quality level.  Their earlier lines were awesome, like the D lines you mentioned.  But unless you get the ATG line, you just won't get the same level of quality they used to offer (in addition, the ATG line is wickedly too expensive - I'd rather get a Durabook for military grade spec at a fraction of the price). 
    Anyway, have fun shopping! :-)
    And moderators or employees of Lenovo, don't you guys get referral bonuses for giving your employee discount code to friends and family?  *wink*
    T61_Wide | Model No. 7662 - CTO
    Core 2 Duo T7250 | 2GB OCZ DDR2-800
    82566MM Gigabit | 4965AGN Centrino Pro

  • Thinking of getting a Curve 8310...pls help me with some questions

    I have an ancient palm centro which I love dearly but the thing is falling apart as I have had it for over 2 years. I recently upgraded to a palm pixi plus but when I found out that I cannot bluetooth or text message calender events to my husband's phone, I returned it. I have a few questions about this phone:
    1.) Can you bluetooth or text message calendar events to another phone that is not a blackberry? And in the same respect, can you receive calendar events from another phone in the same way? This is how I communicate upcoming events with my husband with my centro and it goes right on our calenders with a reminder. I am unwilling to give up this feature.
    2.) I am assuming that blackberry creates a chat log like in my centro during text messaging?
    3.) Can you create birthday reminders from your contact list? I was shocked that the pixi did not have this option.
    4.) Does the phone have a switch on the side to silence the phone and it will vibrate?
    Thank you so much to anyone who takes the time to answer my questions!

    Hey Lizzy731,
    Welcome to the BlackBerry Support Community Forums.
    Here is the answers to your questions.
    1. You can not Bluetooth transfer from one device to another and send calendar events.  However Bluetooth media transfer does work.  If anyone sends you an email with a calendar invite, it will save to your BlackBerry.
    2. When sending and receiving SMS, it does have a record of every message sent and receive.
    3. You do have the option to place in the birthday within a contact.
    4. You do have convenience keys which can be customized to your pleasure, so if you want to make one of the buttons to vibrate only, then you can.
    -ViciousFerret
    Come follow your BlackBerry Technical Team on Twitter! @BlackBerryHelp
    Be sure to click Like! for those who have helped you.
    Click  Accept as Solution for posts that have solved your issue(s)!

  • Where 2 go for help with some questions about a logo design?

    I'm an absolute novice Illustrator user (CS4). Im doing a web site for a mate and he's given me a logo that I have made a vector drawing of. It was black and white, and I made it coloured but I have discovered that colour gets difficult when you go for grayscale! You all knew that, didn't you?
    I'm not putting the logo up here because I don't want to ask a question that's too far off the purpose of the board. So, if I can't show it here can anyone suggest another forum where people do that kind of stuff and are kind to novices please?
    Many thanks
    Martin
    Well, having a look around I think I might not be going to far off by asking so...
    http://www.imagesandwords.org.uk/test/illylogo.html
    Anything really, but bear in mind It's very like the original except it had no style, no color and less er.. precision

    >How can I make the logo better for colour and B&W?
    As I understand it, you are troubled -- among many things -- by the lack of differentiation among the spheres when you convert to grayscale. Is that correct?
    If so, there are some things to consider. For example, the original uses only two attributes -- color and size -- to differentiate the spheres. Otherwise, you have the same shapes and the same gradient fills (other than base color).
    When you remove color from the equation, you're left with only one differentiating attribute: size. Not surprisingly, you find yourself facing a dull uniformity -- the monotonicity produces monotonousness. Now, the challenge is to add back some differentiating features.
    Not a whole lot of choices here. You can develop different gradient fills for a subtle effect, but you have to be careful: If the "lighting" changes dramatically among spheres, you'll end up with an unnatural look.
    You might consider forgetting about gradient fills altogether and go with solid or texture fills. Sometimes, simpler is better... especially with a logo.

  • Some question about Web service

    Hi experts,
    I have created a Web service about Function Module 'BAPI_EXCHANGERATE_GETDETAIL'.Now I plan to use Transaction code 'WSADMIN' to create a WSDL.But the display result of IE tell me my host could not be resolved by DNS.I don't know how to solve this question, and which happened based on this question.Is there any experienced experts tell me the solution?
    Thanks & Best regards!
    Kelvin

    Hi,
    In your system folder:
    C:\WINDOWS\system32\drivers\etc there is a file hosts;
    Add your server I address and servername in it.
    like:
    193.10.100.70     myserver.com     MYSERVER
    Hope this will resolve the problem. If you do not have authorisation for the same, your network admin will help.
    Regards,
    Renjith Michael.

  • Help me with this question about restoring my iphone

    When i went into the apple store the guy was going to restore my iphone to factory settings but i wanted to back it up first so i went home to do it myself and after i restored it everything was still there which should of been deleted (example: like my apps and notes) what did i do wrong? how do i restore my iphone correctly? please help
    Message was edited by: wwwwwwwww
    how do you restore the iphone to factory settings as a new device.

    If you don't want all the stuff that was on before, then you need to restore it as a new device. What you did was to restore your backup with everything you did not want.

  • Is there anyone who can help me with my question about icloud..

    keeps asking for old password, which I can't get because the email account has been deleted, and I can't delete the icloud account, because 'find my phone is on'.....

    You must have a valid email as your apple user name.   Log on to iTunes on the computer and fix your information in the account info.
    Then you can fix the accounts on the device.
    http://support.apple.com/kb/HT2204
    http://support.apple.com/kb/HT5621

  • Grüße Fräulein, Sturm-Verbot-Führer, Hello, we are with some questions

    Grüße Fräulein, Sturm-Verbot-Führer, Hello, we are with some questions about the thought of GBP 77.336, apparently some of our local chapters of chicken producers in Mexico, should be changed, put a small bed of sand and tents in the city. One of the Mexicans, all connections Poncho sniffing glue every time you see him with a hatchet to cut the data cable with an ax. We called immigration and the nature of the problem and Poncho and his producer was a kind of rebellion, threw the chicken **bleep** on the government and is working like crazy NAP. Bryan and our engineers, it seems that the costs of these persons from Mexico, is excited because he said he misses his family in the Middle East, Verizon, I called our 1-800 number and were glad we had rotary phones , but said that someone would go to see these issues with Peter Nam and poncho, if you write an element upstream of the cut of radiation accelerate our DSLAM. Now, with all kinds of components, is accelerating as bowling, and then started kind of breakdown of carbon molecules locally is not always the Internet is like living in Mount St. Helens.

    I'm afraid I don't understand the question.
    If a forum member gives an answer you like, give them the Kudos they deserve. If a member gives you the answer to your question, mark the answer as Accepted Solution so others can see the solution to the problem.
    "All knowledge is worth having."

  • Hello , I want to ask some question about ipads \  How powerful is the iPad?  How useful is it for reading books, newspaper or magazines or for surfing the web? Can you identify any shortcomings of the device?   please help me :(

    Hello ,
    I want to ask some question about ipads \
    How powerful is the iPad? 
    How useful is it for reading books, newspaper or magazines or for surfing the web?
    Can you identify any shortcomings of the device?  
    please help me

    it's less powerful than your average computer. THink of it like a netbook but with a better processor.
    It'll do fine for surfing (although if you browse a lot of flash based sites you will need to get a third party browser since safari doesn't accommodate it)
    You may do OK on reading books, papers or magazines, especially if they have apps, but the ipad's screen is backlit, so it doesn't work well outdoors and you may need to fiddle with the brightness so that you don't get eye strain (it's just like doing too much reading from a computer screen)
    I would say the biggest short comings are data transfer. Apple's preferred work flow is that everything is done via iTunes or the internet....well people dont' always have 100% reliable always on internet access so you can find yourself in a situation where you can't get things on/off the iPad.
    By and large, it's a good device for day to day stuff, but is not a computer replacement.

  • Some question about 9iAs R1.2.2 & R2, need your help:

    Some question about 9iAs R1.2.2 & R2, need your help:
    Since 2000, we has used 9iAS Core (R1.2.2) to publish our website. The platform is Suns Solaris (SPARC). The database is Oracle 8i. But there are so many questions:
    1.     The Web Cache cant be installed well
    2.     The web pages use JSP to query database with SQL show errors when we refresh the page a few times. The error will disappear after restarting the 9iAS or refreshing the page again. On the other hand, the same pages dont show error on resin. The error is java.sql.SQLException : Closed Connection: next. I supposed that the connection of database has some hidden troubles, but I can find it, could you give me some advice.
    Now I have installed 9iAS R2, But when I visited the manage page, I found that a password is needed to visit the web cache manage page. I dont think I have set the password, and then I cant control the web cache. I want to know is a default password occurred? If not, what is the password.

    The default password for Web Cache is: administrator
    See walkthrough on the sample code page: http://otn.oracle.com/sample_code/products/ias/content.html
    HTH,
    Ashesh Parekh
    Oracle9iAS product management

  • I have to make a catalouge for my services as a financial planner.. earlier i used to do in MS publisher.. now i have a mac book.. can some one help me with some software info with which i can design a catalogue??

    I have to make a catalouge for my services as a financial planner.. earlier i used to do in MS publisher.. now i have a mac book.. can some one help me with some software info with which i can design a catalogue??

    Depending on what your needs are, you may use Pages included in iWork or purchase it separately (usually there is an evaluation copy with any new mac, I guess) or try other publishing apps. I once used MS Publisher, I remember it was something like a more sophisticated word processor, right?
    You may try the cheaper DTP iCalamus or Word for mac.

  • Some questions about javacard 2.1.1 and smartcardio

    Hello i have some question about java card 2.1.1 and the smartcardio package.
    1.) I want to sign a message with the Signature.ALG_RSA_SHA_PKCS1 algorithm. I use the following code in the applet to sign the message:
    final static byte P1_CREATION_MODE = (byte) 0x01;
    final static byte INS_SIGN_MODE = (byte) 0x60;
    final static byte SmartCard_CLA = (byte) 0xB0;
    private void signMessage(APDU apdu) {
            byte[] buffer = apdu.getBuffer();
            byte byteRead = (byte) (apdu.setIncomingAndReceive());
            signature.init(privateKey, Signature.MODE_SIGN);
            short length = signature.sign(buffer, ISO7816.OFFSET_CDATA, byteRead, buffer, (short) 0);
            apdu.setOutgoingLength((short) length);
            apdu.sendBytesLong(buffer, (short) ISO7816.OFFSET_CDATA, (short) length);
            apdu.setOutgoing();
        }On the host side I use the following code to connect to the card and to send the sign apdu:
    if (TerminalFactory.getDefault().terminals().list().size() == 0) {
                LOGGER.log(Level.SEVERE, "No reader present");
                throw new NoSuchCardReader();
            /* Select the first terminal*/
            CardTerminal terminal = TerminalFactory.getDefault().terminals().list().get(0);
            /* Is a card present? */
            if (!terminal.isCardPresent()) {
                LOGGER.log(Level.SEVERE, "No Card present!");
                throw new NoSuchCard();
            /* Set the card protocol */
         Card card = terminal.connect("*");
            ATR atr = card.getATR();
            LOGGER.fine(getHexString(atr.getBytes()));
            LOGGER.fine(getHexString(atr.getHistoricalBytes()));
            CardChannel channel = card.getBasicChannel();
            CommandAPDU cmd = new CommandAPDU((byte) 0xb0, (byte) 0x60, (byte) 0x01, (byte) 0x00, new String("datadatdatadata").getBytes(), (byte) 0x40);
         ResponseAPDU response = channel.transmit(cmd);
            card.disconnect(false);But this does not work and i got the following error
    javax.smartcardio.CardException: sun.security.smartcardio.PCSCException: Unknown error 0x8010002f
            at sun.security.smartcardio.ChannelImpl.doTransmit(ChannelImpl.java:202)
            at sun.security.smartcardio.ChannelImpl.transmit(ChannelImpl.java:73)
            at de.upb.client.smartmeter.SmartMeter.initSmartCardApplet(SmartMeter.java:114)
            at de.upb.client.smartmeter.SmartMeterApplikation.main(SmartMeterApplikation.java:39)
    Caused by: sun.security.smartcardio.PCSCException: Unknown error 0x8010002f
            at sun.security.smartcardio.PCSC.SCardTransmit(Native Method)
            at sun.security.smartcardio.ChannelImpl.doTransmit(ChannelImpl.java:171)
            ... 3 more2.) 3Des encryption
    I want to use the 3Des algorithm to encrypt my data. I use
    keyDES = (DESKey) KeyBuilder.buildKey(KeyBuilder.TYPE_DES,
                        KeyBuilder.LENGTH_DES3_2KEY, false);
    cipherDES = Cipher.getInstance(Cipher.ALG_DES_CBC_ISO9797_M2, false);But i do not know what is the aquivalent on the host side??
    3.) Another problem is that i am not able to send the modulus of a public key from the host applikation to the smard card
    new CommandAPDU((byte) 0xb0, (byte) 0x20, (byte) 0x01, (byte) 0x00, modulus.toByteArray()); // create the apdu
    // the method in the applet
    private void setServerKeyMod(APDU apdu) {
            byte[] buffer = apdu.getBuffer();
            try {
                byte byteRead = (byte) (apdu.setIncomingAndReceive());
                short off = ISO7816.OFFSET_CDATA;
                // strip of any integer padding
                if (buffer[off] == 0) {
                    off++;
                    byteRead--;
                publicKeyServer.setModulus(buffer, off, byteRead);
            } catch (APDUException ex) {
                ISOException.throwIt((short) (SW_APDU_EXCEPTION + ex.getReason()));
        }The error code is 6700
    4.) My last problem ist, that i am not able to use a value bigger than 0x7F as the ne field in the apducommand, because i get the following error
    CommandAPDU((byte) 0xb0, (byte) 0x60, (byte) 0x01, (byte) 0x00, data, (byte) 0xff);
    java.lang.IllegalArgumentException: ne must not be negative
            at javax.smartcardio.CommandAPDU.<init>(CommandAPDU.java:371)
            at javax.smartcardio.CommandAPDU.<init>(CommandAPDU.java:252)I thought that it this should be possible in order to use all the bytes of the response apdu.
    If you need more code to help please let me know.
    Cheers
    Edited by: 858145 on 06.07.2011 08:23

    2) What is PKCS? what is the difference between
    PKCS#11 and PKCS#15??PKCS is the abbreviation of "Public-Key Cryptography Standards"
    PKCS #11: Cryptographic Token Interface Standard
    See http://www.rsasecurity.com/rsalabs/node.asp?id=2133
    PKCS #15: Cryptographic Token Information Format Standard
    http://www.rsasecurity.com/rsalabs/node.asp?id=2141
    If you want to use yor smartcard as secure token it doesn't have to be a JavaCard.
    BTW: I don't remember a way to access PKCS#15 tokens on a JavaCard from within an oncard JavaCard program. If you want to use keys in your oncard program, you have to transfer it onto the card or generate it oncard and export the public key by your own oncard/offcard code.
    Jan

  • Some questions about configuration in MAX.

    Hello,everyone!
    I have some questions about configuration in MAX(I am a jackaroo for motion control development),I hope I can get your help.
    I use PCI-7344+UMI-7764+Servo amplifier+Servo motor,my MAX version is 4.2 and I use NI-Motion7.5
    My question as following:
    1,In Axis Configuration,for motor type,why I must select stepper but not servo?my motor is servo motor!If I select Servo,my motor can't run,I don't know why.
     If I select stepper,though motor can work but I can't test encoder in MAX.
    2,In Stepper settings,for stepper loop mode,why I must select open-loop but not close-loop?If I select close-loop,the servo motor doesn't work too.
    3,If I want my two servo motors run at different velocity,How shoud I do?It seems I just can set the same velocity in MAX for my two servo motors.
     My English is poor,Pls pardon me!I come from China.
    Thank you for your help!
    EnquanLi
    Striving is without limit!

    Hi,Jochen,
    Thank you for your kindly help!
    The manufacturer of the drive and motor that I am using now is Japan SANYO DENKI,drive type is RS1A01AA,motor type is R2AA06020FXP00.
    And I use position control mode,thehe encoder's counts per revolution is 131072.I set the electronic gear ratio to 1:1 for drive.
    Now,I can use Close-Loop to control the motor but still has some problems.When I configure it to run in closed loop mode, the motors behave strangely and never move to the target position.When I configure it to run in closed loop mode, the motors behave strangely and never move to the target position.The detail situation is as following
    1,Motor can't run.
    2, Or motor moves to a position, then moves in the same direction agian and eventually stops.
    Except for the  two points mentioned above,"Following Error" is  occured frequently,I don't know why.
    I am still not clear why I must set the motor type be stepper in MAX .
    And I have another question:what the relationship between the steps and the counts?They have the proportion relations?I notice that there are a section said like this in help document: For proper closed-loop and p-command operation, steps per revolution/counts per revolution must be in the range of 1/32,767 < steps/counts < 32,767. An incorrect counts to steps ratio can result in failure to reach the target position and erroneous closed-loop stepper operation.
    I am verry sorry I have too many questions!
    I am very appreciate for your kingly help!Thanks again!
    EnquanLi
    China
    Striving is without limit!

Maybe you are looking for

  • Song is not available in Russian iTunes Store

    Why this song is not available in Russian iTunes Store?  https://itunes.apple.com/us/album/michael-jackson-beat-goes/id550164893

  • BED,ECS and SECess value not defaulted in J1IS for return purchase order.

    1)I have created return purchase orde for an excisable material. 2) In the purchase order i am able to view the BED,ECS and SEcess values. 3) I have created MIGO, for the return purchase order with excise as part 1 only. 4) While doing J1is or the 16

  • Can't view pictures or video'ss

    Hello fellow palmers riddle me this?? I have a treo 750 unlocked smartphone and I am unable to view pictures sent to me aswell as video clips. My provider is T-mobile and they told me there is a firmware issue that can be fixed with updating the ROM?

  • Installaton problem on X86

    hey all i installed solaris 10 on my system with configuration intel 915 GAV , 512 mb RAM, western digital 80 gb SATA, microsoft keyboard and mouse but after installation the GUI doesnt come . (while installing it also skipped some of network cofigur

  • I'm back in the states and i still have a problem with iTunes account

    While I was in the dominican republic I wasn't able to make purchases in the iTunes store.  I found out it was because I have a us account.  But now I'm back but it still is not working and everything I try to do make it work is not fixing the proble