Results 1 to 5 of 5
  1. #1
    sardare is offline Member
    Join Date
    Jun 2008
    Posts
    17
    Rep Power
    0

    Default isolated task in java

    Hi,

    I want to do a task in a separate thread in java where the task is completely isolated from the outside world and there is no way for it to access the outside world variables. How to enforce this restriction practically as the task is written by anyone and I am providing a wrapper around a task to prevent it from accessing outside world.

    Is it something that can be done in java?

    thanks,
    samit

  2. #2
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,559
    Rep Power
    25

    Default

    access the outside world variables
    Not sure what those are.
    to prevent it from accessing outside world.
    What does that mean?
    If you can control the ClassLoader that the task uses, you can control what classes it can instantiate.

  3. #3
    sardare is offline Member
    Join Date
    Jun 2008
    Posts
    17
    Rep Power
    0

    Default

    Quote Originally Posted by Norm View Post
    Not sure what those are.

    outside the threads address space. e.g., class static variables that thread can access.

    What does that mean?
    If you can control the ClassLoader that the task uses, you can control what classes it can instantiate.
    if I use a different class loader to instantiate my thread, it could still access the statics inside other classes and other shared variables..

  4. #4
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,559
    Rep Power
    25

    Default

    To isolate the task, you could start it in another JVM. You would need a very tight sandbox to isolate the program from the world.

    What is the purpose of this isolation?

    Have you looked at the SecurityManager class?
    Last edited by Norm; 09-04-2008 at 03:12 AM.

  5. #5
    Nicholas Jordan's Avatar
    Nicholas Jordan is offline Senior Member
    Join Date
    Jun 2008
    Location
    Southwest
    Posts
    1,018
    Rep Power
    8

    Post purpose?

    The purpose of the isolation is of critical centrality in providing design studies. In general, for simple designs, all that is needful is to code carefull with stringent observation of code correctness. If it is a real security issue, then then you need to come in from a differerent window of ideas.

    If possible, provide short - fabricated code snippets to model the design concern.

    Is this a student or study project?
    Introduction to Programming Using Java.
    Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor

Similar Threads

  1. java : how to hide application icon from a task bar
    By yogeshagashe in forum Advanced Java
    Replies: 0
    Last Post: 03-12-2008, 01:05 PM
  2. Scheduling a task
    By bugger in forum Advanced Java
    Replies: 3
    Last Post: 12-04-2007, 12:32 PM
  3. Task Blocks 0.5
    By johnt in forum Java Software
    Replies: 0
    Last Post: 08-08-2007, 08:43 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •