About method 'write(int b)' in class 'OutputStream'

Hello, everyone,
In OutputStream class, there is a method called "write(int b)". In the API Specification, the explanation of this method is: Writes the specified byte to this output stream.
I am just wondering, if the type of b is 'int', then how can it say " to write the byte to the stream"?

Because the lower 8 bits of an int are the same value as a byte.
-1 ==> 11111111 11111111 11111111 11111111 ==> 11111111
0 ==> 00000000 00000000 00000000 00000000 ==> 00000000
1 ==> 00000000 00000000 00000000 00000001 ==> 00000001
255 ==> 00000000 00000000 00000000 11111111 ==> 11111111
So it's essentially the same thing. Just chops off the upper 24 bits. The other thing is it's not uncommon to maintain byte values in ints for unsigned-ness, and if the method took a byte, it would require an explicit cast do to possible loss of precision, whereas a byte can be implicitly cast to an int with no alteration to the actual value represented.

Similar Messages

  • A question about the getProperty method defined in the Security class

    Hello Everyone!
    I would like to ask a question about the getProperty method defined in the
    Security class.
    public static String getProperty(String key) Do you know how can I exract the list of all possible keys?.
    Thanks in advance,

    I found the answer, in fact the keys are defined in the java.security file.

  • Question about methods in a class that implements Runnable

    I have a class that contains methods that are called by other classes. I wanted it to run in its own thread (to free up the SWT GUI thread because it appeared to be blocking the GUI thread). So, I had it implement Runnable, made a run method that just waits for the thread to be stopped:
    while (StopTheThread == false)
    try
    Thread.sleep(10);
    catch (InterruptedException e)
    //System.out.println("here");
    (the thread is started in the class constructor)
    I assumed that the other methods in this class would be running in the thread and would thus not block when called, but it appears the SWT GUI thread is still blocked. Is my assumption wrong?

    powerdroid wrote:
    Oh, excellent. Thank you for this explanation. So, if the run method calls any other method in the class, those are run in the new thread, but any time a method is called from another class, it runs on the calling class' thread. Correct?Yes.
    This will work fine, in that I can have the run method do all the necessary calling of the other methods, but how can I get return values back to the original (to know the results of the process run in the new thread)?Easy: use higher-level classes than thread. Specifically those found in java.util.concurrent:
    public class MyCallable implements Callable<Foo> {
      public Foo call() {
        return SomeClass.doExpensiveCalculation();
    ExecutorService executor = Executors.newFixedThreadPool();
    Future<Foo> future = executor.submit(new MyCallable());
    // do some other stuff
    Foo result = future.get(); // get will wait until MyCallable is finished or return the value immediately when it is already done.

  • How to add a code TestIfElse(10) to the Main method of the Program.cs class?

    How to add a code  TestIfElse(10) to the Main method of the Program.cs class?
    Here is my code and I have copied from the Wiley book for Microsoft certification page 14,
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    namespace ifelse_Statement
        class Program
            static void Main(string[] args);
            TestIfElse(10);
            public static void TestIfElse(int n);
            if(n < 10)
                     Console.WriteLine("n is less than 10");
             else if(n < 20)
                    Console.WriteLine("n is less than 20");
             else if(n < 30)
                Console. WriteLine("n is greater than or equal to 30");
    Here is the error list I am getting,
    Error 1      Method must have a return type        C:\Users\PVS\documents\visual studio 2013\Projects\Lesson01\switch_Statement\Program.cs
    12 13
    switch_Statement
    Error 2
    Type expected C:\Users\PVS\documents\visual studio 2013\Projects\Lesson01\switch_Statement\Program.cs
    12 24
    switch_Statement
    Error 3
    Method must have a return type C:\Users\PVS\documents\visual studio 2013\Projects\Lesson01\ifelse_Statement\Program.cs
    12 9
    ifelse_Statement
    Error 4
    Type expected C:\Users\PVS\documents\visual studio 2013\Projects\Lesson01\ifelse_Statement\Program.cs
    12 20
    ifelse_Statement
    Error 5
    Invalid token 'if' in class, struct, or interface member declaration
    C:\Users\PVS\documents\visual studio 2013\Projects\Lesson01\ifelse_Statement\Program.cs
    16 9
    ifelse_Statement
    Error 6
    Invalid token '10' in class, struct, or interface member declaration
    C:\Users\PVS\documents\visual studio 2013\Projects\Lesson01\ifelse_Statement\Program.cs
    16 16
    ifelse_Statement
    Error 7
    Type expected C:\Users\PVS\documents\visual studio 2013\Projects\Lesson01\ifelse_Statement\Program.cs
    16 16
    ifelse_Statement
    Error 8
    Invalid token '(' in class, struct, or interface member declaration
    C:\Users\PVS\documents\visual studio 2013\Projects\Lesson01\ifelse_Statement\Program.cs
    18 35
    ifelse_Statement
    Error 9
    A namespace cannot directly contain members such as fields or methods
    C:\Users\PVS\documents\visual studio 2013\Projects\Lesson01\ifelse_Statement\Program.cs
    20 10
    ifelse_Statement
    Error 10
    Type or namespace definition, or end-of-file expected
    C:\Users\PVS\documents\visual studio 2013\Projects\Lesson01\ifelse_Statement\Program.cs
    30 1
    ifelse_Statement
    Error 11
    The type or namespace name 'n' could not be found (are you missing a using directive or an assembly reference?)
    c:\users\pvs\documents\visual studio 2013\projects\lesson01\ifelse_statement\program.cs
    16 12
    ifelse_Statement
    Error 12
    'System.Console.WriteLine(string, params object[])' is a 'method' but is used like a 'type'
    c:\users\pvs\documents\visual studio 2013\projects\lesson01\ifelse_statement\program.cs
    18 26
    ifelse_Statement

    static void Main(string[] args){
    TestIfElse(10);
    public static void TestIfElse(int n)
    if (n < 10)
    Console.WriteLine("n is less than 10");
    else if (n < 20)
    Console.WriteLine("n is less than 20");
    else if (n < 30)
    Console.WriteLine("n is greater than or equal to 30");
    Fouad Roumieh

  • Using Java Reflection to call a method with int parameter

    Hi,
    Could someone please tell me how can i use the invoke() of the Method class to call an method wiht int parameter? The invoke() takes an array of Object, but I need to pass in an array of int.
    For example I have a setI(int i) in my class.
    Class[] INT_PARAMETER_TYPES = new Class[] {Integer.TYPE };
    Method method = targetClass.getMethod(methodName, INT_PARAMETER_TYPES);
    Object[] args = new Object[] {4}; // won't work, type mismatch
    int[] args = new int[] {4}; // won't work, type mismatch
    method.invoke(target, args);
    thanks for any help.

    Object[] args = new Object[] {4}; // won't work, type
    mismatchShould be:
        Object[] args = new Object[] { new Integer(4) };The relevant part of the JavaDoc for Method.invoke(): "If the corresponding formal parameter has a primitive type, an unwrapping conversion is attempted to convert the object value to a value of a primitive type. If this attempt fails, the invocation throws an IllegalArgumentException. "
    I suppose you could pass in any Number (eg, Double instead of Integer), but that's just speculation.

  • GregorianCalendar method add(int,int) in websphere5.1

    This bug report landed in my lap. The program is registering payments, and when user is registering multiple payments he gets the duedate set to 1970 from the second payment and on. Someone wrote on the bug report "method add(int,int) in GregorianCalendar doesn't work in WebSphere 5.1".
    So, when t>0 in the following code, things go haywire. Anyone have experience with this?
    dueDateG.clear();
    dueDateG.setLenient(false);
    dueDateG.setTime(dueDate);
    if (t==0)   addMonth = 0;
    else        addMonth = freq;
    dueDateG.add(Calendar.MONTH, addMonth);
    date = dueDateG.getTime();
    dueDate = date;

    By "Websphere 5.1" are you meaning Websphere Application Server 5.1 or Websphere Application Developer 5.1?
    The former (as known as WAS) uses IBM JDK 1.4.X (I believe that's 1.4.1); the later (as known as WSAD) can be used with any version of WAS starting from 4.X I believe.
    Some things can have problems when you're using IBM JDK's instead of Sun's, for instance trying to use the javax.crypto.* classes, that are different from Sun's; but I don't know if GregorianCalendar has problems. The first thing to do is insulate the code that you sent and try running it in IBM's and Sun's JDK. If you get problems only with IBM's JDK, you'll need to rewrite your code.

  • Few basic doubts about accessing AM from backing bean class

    Hi ADF experts,
    I have just started working in ADF Faces.I made a sample search page.My page is attached to a managed backing bean. I have attached command button on my page to a custom method in backing bean class.
    So on, click of button this method is called in backing bean.Now, i have few doubts:
    1)How to get values of various UI beans in this event code?
    2)I am accesing AM , in my method with this code:
    FacesContext facesContext = FacesContext.getCurrentInstance();
    ExternalContext extContext = facesContext.getExternalContext();
    Application app = facesContext.getApplication();
    DCBindingContainer binding = (DCBindingContainer)app.getVariableResolver().resolveVariable(facesContext, "bindings");
    //Accessing AM
    ApplicationModule am = binding.getDataControl().getApplicationModule();
    iS this correct ?
    3) After getting handle of am how to call my custom method in AM Class?there was "invokeMethod" API in application module class in OAF, is there any such method here?
    Please help me.
    --ADF learner.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Thanks for ur response Frank, actually I am from OA Framework back ground.It would be great if help us a little with ur valuble thoughts.
    OA Framework also uses bc4j in model layer of framework. We have a requirement where our existing developers from OA Framework have to move to ADF to make a new application where time lines are quite strict.If this would not be possible we will switch to plain jsp and jdbc,but our tech experts say ADF Faces is the best tech.
    In OA Framework, Application Module is key class for all busiess logic and Controller is used for page navigation. So, I m just trying to find the same similarity , where we write we add all event codes in custom action methods in the backing bean class of page, which we consider equivalent to process form request method in Controller class of OAF.
    But there are two things, I still want to know:
    1)While page render, how to call specific AM methods(like setting where clause of certain VOs)
    2)In action methods, the way i described(I found that in one thread only)to access AM, what is wrong in that?Also, I went through
    http://radio.weblogs.com/0118231/stories/2004/09/23/notYetDocumentedAdfSampleApplications.html
    where coule of examples use similar approach to access AM from backing bean class and call custom methods of AM(Doing various, deletes etc from VOs).
    3)In these methods can we set any property of beans on the page, I am asking because in OAF, generally we use PPR for js alternatives.But all properties of beans cannot be set in post event.
    Thanks and Regards
    --ADF Learner                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Method init not found in class oracle.apps.fnd.cp.request.C

    Hi all,
    I am reffering to Oracle Application Framework Developer’s Guide Release
    11.5.10 RUP3 December 2, 2005
    As given in the document (page 275) Concurrent Processing: Request Submission
    and Monitoring ,I want the Concurrent Processing Request Submission and Monitoring user interfaces available on my OA Framework-based pages.
    I have followed the steps given in the OADevGuide but when the custom CO
    is compiled it gives following error.
    method <init> not found in class oracle.apps.fnd.cp.request.ConcurrentRequest.
    The import statement in our code is as followed
    import oracle.apps.fnd.cp.request.ConcurrentRequest;
    import oracle.apps.fnd.cp.request.RequestSubmissionException;
    wheather I have to open a SR on metalink asking for an updated file ConcurrentRequest.class ?
    Thanks in advance,
    Anant.

    Hi All,
    Thanks Prabhat for that update.
    Thanks tapashray cause u r update on thread Apply not being caught in debugger helped me a lot.
    Right now I am facing a different problem.
    On click of submit button The page gets called but it gives error as
    oracle.apps.fnd.framework.OAException: Could not load application module 'oracle.apps.fnd.cp.srs.server.RequestAM'.
    In myprojects folder under oracle dir at reqd path I have this AM .
    Whether I need to add the bc4j pkg "oracle.apps.fnd.cp.srs.server.RequestAM" in my project . I dont think so as I am not extending any class/VO or doing any substitution.
    my code is as followed
    public void processFormData(OAPageContext pageContext, OAWebBean webBean)
    System.out.println("Inside ProcessFormData");
    if (pageContext.getParameter("Submit")!= null )
    System.out.println("Inside Submit ");
    try
    // get the JDBC connection
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    //Connection conn = (Connection)am.getOADBTransaction();
    OADBTransaction conn = am.getOADBTransaction();
    System.out.println("OADBTransaction conn "+conn);
    ConcurrentRequest cr = new ConcurrentRequest(conn.getJdbcConnection());
    System.out.println(" ConcurrentRequest cr "+cr);
    cr.setDeferred();
    // call submit request
    Vector param = new Vector();
    String selectedValue = pageContext.getParameter("reportList");
    System.out.println("selectedValue -> "+selectedValue);
    param.add(selectedValue);
    System.out.println("before cr.submitRequest ");
    int reqId = cr.submitRequest("SQLGL", "RGFSGXML", "Run FSG and XML Publisher",null, false, param);
    // int reqId = cr.submitRequest("SYSADMIN", "FNDSCURS", "User Responsibility Report",null, false, param);
    System.out.println("After cr.submitRequest reqId "+reqId);
    conn.commit();
    System.out.println("After commit");
    // redirect page to Request Scheduling page
    HashMap parameters = new HashMap();
    String url = "OA.jsp";
    parameters.put("akRegionApplicationId", "0");
    parameters.put("akRegionCode", "FNDCPPROGRAMPAGE");
    String id = "" + reqId + "";
    parameters.put("requestMode", "DEFERRED");
    parameters.put("requestId", id);
    System.out.println("before page forward ");
    pageContext.setForwardURL("BSE_CONC_REQUEST"
    ,OAWebBeanConstants.KEEP_MENU_CONTEXT
    ,null
    ,parameters
    ,true
    ,OAWebBeanConstants.ADD_BREAD_CRUMB_NO
    ,OAWebBeanConstants.IGNORE_MESSAGES);
    catch(RequestSubmissionException reportError)
    System.out.println("RequestSubmissionException raised "+reportError.getStackTrace());
    catch(SetDeferredException deferred)
    System.out.println("SetDeferredException raised "+deferred.getStackTrace());
    super.processFormData(pageContext,webBean);
    Hope I have given all the details.
    Regards,
    Anant.
    Message was edited by: Removed the error stack so that thread details remain on the same page
    Anant

  • Where to put methods in a abstract base class - subclasses system

    Hi,
    I’d like to ask a question on some basic design practice.
    When there are methods which are common in some subclasses so I would like to “move them up” in the base abstract class, I would also like to make sure that the ADT concept of the base class itself is not broken. So I don’t want to have methods in the base class that are not general enough to be there. How to resolve this?
    For example I create a base abstract class Vehicle. Then I create subclasses Plane and Tanker and realize that the startEnginge() method in them is the same and in order remove the duplicated code, I can put it in Vehicle. But later there may be Bicycle or Sled subclasses which don’t need startEngine().
    In a broader sense, I would like to keep the Vehicle class as similar to the real word concept of vehicles as possible. And not evey vehicle have engine of course.
    What is the solution?
    Extending the class hierarchy by injecting another abstract class between the base and the subclasses? (e.g: VehicleWithEngine)
    I suppose I can’t use Interfaces because I need to have the common implemenations as well.
    Thanks for any comments in advance,
    lemonboston
    ps: I am a beginner and don't know the terminology, so if there are programming expression for the followings for example, I would be thankful if someone could help with this too:
    - moving common methods up in the class hierarchy
    - injecting a class in the hierarchy
    - abstract base class - subclasses system

    lemonboston wrote:
    Hi,
    I’d like to ask a question on some basic design practice.
    When there are methods which are common in some subclasses so I would like to “move them up” in the base abstract class, I would also like to make sure that the ADT concept of the base class itself is not broken. So I don’t want to have methods in the base class that are not general enough to be there. How to resolve this?
    You are talking about code.
    Instead you need to talk about the design.
    The base class represents conceptually a 'type' of something. That 'type' defines behavior. That behavior is what goes in the base class nothing else (in terms of design.)
    If you have common functionality which does not fit into the definition (design) of the 'type' then you put it in another class and use (composition) that class in the sub class.
    For example I create a base abstract class Vehicle. Then I create subclasses Plane and Tanker and realize that the startEnginge() method in them is the same and in order remove the duplicated code, I can put it in Vehicle. But later there may be Bicycle or Sled subclasses which don’t need startEngine(). No that is not how it works.
    You have specific examples of some vehicles and then you need to manage those types generically. That is the first step.
    Second step is then to determine what the exact 'type' is that you want to manage. And you use the requirements of the need to create the 'type'.
    Then you look at the specific examples to determine how they will meet the needs of the type.
    Thus if I have an application that must start the engines of all the vehicles in the city then I must have a vehicle class which has startEngine.
    But if I have an application that manages vehicles as inventory (like a retail store) and then decide that because my examples both have engines that I might as well move it into the base class. In that case there is no 'need' for the application to manage starting vehicles. The fact that both have engines is irrelevant.
    So looking back at your example you have stated functionality about your specific types but you have not stated anything about why your application needs to deal with that functionality generically.
    Another way to think about it is that you do not put the shared functionality in the base because you can but rather because you must.

  • Using Methods not Defined in a class that you are calling them from

    For one of my assignment I have had to create a class with methods and then create another class to test the methods.
    I keep getting the error message "cannot resolve symbol"
    And the error points to the line where I am calling the class.
    I have put the classes in a package and imported them.
    Here is the method I am calling.
    public boolean validDate(int day, int month, int year)
    if(leapYear(year))
    daysInMonth = 29;
    else
    getNumberOfDaysInMonth(month);
    return true;
    This is how I am calling it from the test class
    if(validDate(day1,month1,year1))
    testnewDate.java:38 cannot resolve symbol
    symbol : method validDate(int,int,int)
    location:class newdate.testnewDate
    if(validDate(day1,month1,year1))
    ^
    If anyone is able to help I can give you my java source files if I haven't given enough information.

    You can't call another class's method directly from your class. You need to get an object of that class and should call the method using that object.
    If you have written public boolean validDate(int day, int month, int year) method in class DateValidator, then from your test class, you have to call that like this,
    DateValidator dv = new DateValidator();
    if(dv.validDate(day1,month1,year1)) {
    // Take actions
    Hope it is clear.
    Sudha

  • How to write comments for a class

    hi
    how to write comments for a class

    I'm reeling with incredulity, and as such am unable to do anything except just post some code
    // this is a single line comment
    /* this is a multiline comment.
        it can be spread over as many lines as you
        want */Or are you asking about how to decide what the content should be?

  • About method

    Look at the code below and can you tell me why the code prints out:
    SuperClass Constructor Executed
    SubClass Constructor Executed
    methodA in Superclass
    methodB in Superclass//Why not prints out methodB in Subclass,since methodB in sub has been overriden
    9
    public class Superclass {
    Superclass() {
    System.out.println("SuperClass Constructor Executed");
    private int methodB() {
    System.out.println("methodB in Superclass");
    return 9;
    int methodA() {
    System.out.println("methodA in Superclass");
    return methodB();
    class Subclass extends Superclass {
    Subclass() {
    System.out.println("SubClass Constructor Executed");
    public static void main(String[] args) {
    System.out.println(new Subclass().methodA());
    protected int methodB() {
    System.out.println("methodB in Subclass");
    return 1;
    }

    hi,but can you tell me how java virtual machine
    identify methodB() when methodA calls is the version
    of Superclass,not of Subclass?I'm not sure I understand the question?
    If methodB is private or "package", then at compile time the compiler knows which method is to be called. If the method is protected or public, then it can be overridden and the check must be made at runtime; It doesn't matter which class the method is declared in - it is called on an object, not on the class! (note that you get different behaviour with static methods, which you don't actually override, but hide, and do infact call on the class rather than an object).
    And can you tell me whether there is an instance of
    Superclass is created when an instance of Subclass is
    declared and created?No. Just a single instance of Subclass is created, but to properly initialise that instance the code in the Superclass constructor must be executed.

  • Question about method calling (Java 1.5.0_05)

    Imagine for example the javax.swing.border.Border hierarchy.
    I'm writing a BorderEditor for some gui builder, so I need a function that takes a Border instance and returns the Java code. Here is my first try:
    1 protected String getJavaInitializationString() {
    2     Border border = (Border)getValue();
    3     if (border == null)
    4         return "null";
    5
    6     return getCode(border);
    7 }
    8
    9 private String getCode(BevelBorder border) {...}
    10 private String getCode(EmptyBorder border) {...}
    11 private String getCode(EtchedBorder border) {...}
    12 private String getCode(LineBorder border) {...}
    13
    14 private String getCode(Border border) {
    15     throw new IllegalArgumentException("Unknown border class " + border.getClass());
    16 }This piece of code fails. Because no matter of what class is border in line 6, this call always ends in String getCode(Border border).
    So I replaced line 6 with:
    6     return getCode(border.getClass().cast(border));But with the same result. So, I try with the asSubClass() method:
    6     return getCode(Border.class.asSubClass(border.getClass()).cast(border));And the same result again! Then i try putting a concrete instance of some border, say BevelBorder:
    6     return getCode(BevelBorder.class.cast(border));Guess what! It worked! But this is like:
    6     return getCode((BevelBorder)border);And I don't want that! I want dynamic cast and correct method calling.
    After all tests, I give up and put the old trusty and nasty if..else if... else chain.
    Too bad! I'm doing some thing wrong?
    Thank in advance
    Quique.-
    PS: Sorry about my english! it's not very good! Escribo mejor en espa�ol!

    Hi, your spanish is quite good!
    getCode(...) returns the Java code for the given border.
    So getCode(BevelBorder border) returns a Java string that is something like this "new BevelBorder()".
    I want Java to resolve the method to call.
    For example: A1, A2 and A3, extends A.
    public void m(A1 a) {...}
    public void m(A2 a) {...}
    public void m(A3 a) {...}
    public void m(A a) {...}
    public void p() {
        A a = (A)getValue();
        // At this point 'a' could be instance of A1, A2 or A3.
        m(a); // I want this method call, to call the right method.
    }This did not work. So, i've used instead of m(a):
        m(a.getClass().cast(a));Didn't work either. Then:
        m(A.class.asSubClass(a.getClass()).cast(a));No luck! But:
        m(A1.class.cast(a)); // idem m((A1)a);Woks for A1!
    I don't know why m(A1.class.cast(a)) works and m(a.getClass().cast(a)) doesn't!
    thanks for replying!
    Quique

  • (261680070) Q SYNCH-11 How do my web service methods accees EJBs and java classes?

    A<SYNCH-11> How do my web service methods accees EJBs and java classes?
    A<SYNCH-11> It is simple to use java classes, just do it as you would ordinarily.
    The .jws file really contains a simple class so you can program with it in the same
    way that you would use a regular Java class.
    To use an EJB you can go and access it directly as you would with any EJB remote
    client (lookup home stub, create, etc) or if the EJB is deployed to WLS you can use
    a control to provide a very simple wrapper to the EJB. We will see this in detail
    on Thursday in the ADVC module.

    Futher information about the possibility of callback:
    It may be possible for a synchronous only web service (i.e. MS .net) to even paticipant
    in the callback functionality of asynchronous web services. If the client implements
    the appropriate methods for the callback but listens for them on a different port
    or binding than the SOAP request, then web service may be able to build a response
    if the client's "callback URL" is submitted as the beginning part of a conversation.
    Watch the BEA developer forum (http://dev2dev.bea.com) for more information about
    this approach and other tips and techniques for building web services.
    "Adam FitzGerald" <[email protected]> wrote:
    >
    Q<SYNCH-03> I heard that MS .net only implements synchrnonus method? If
    this is true.
    Does it means my async methods will only work with J2EE clients?
    A<SYNCH-03> I do not know the limitations of .net but let me point out that
    is very
    difficult to provide asynchronous web service method invocation (this is
    different
    from an asynchronous web service). HTTP as a general communication protocol
    is based
    on a request and response paradigm so your client libraries will mostly
    likely be
    expecting a response even if it is empty (check the asynchronous example
    from today
    to see that the start method still returns an empty response). You must
    distinguish
    this from the notion of an asynchronous web service which is a business
    operation
    that occurs on the server whose return value/result is not directly associated
    with
    building response to the client. An asynchronous web service can (and generally
    will)
    be started and stopped with web service operations that are invoked synchronously.
    Thus MS .net clients can still be client to WLS hosted web services.

  • "Abstract" method in a non-abstract class

    Hi all.
    I have a class "SuperClass" from which other class are extended...
    I'd like to "force" some methods (method1(), method2, ...) to be implemented in the inherited classes.
    I know I can accomplish this just implementing the superclass method body in order to throw an exception when it's directly called:
    void method1(){
    throw new UnsupportedOperationException();
    }...but I was wondering if there's another (better) way...
    It's like I would like to declare some abstract methods in a non-abstract class...
    Any ideas?

    The superclass just models the information held by
    the subclasses.
    The information is taken from the database, by
    accessing the proper table (one for each subclass).??
    What do you mean by "models the information"?
    You should use inheritance (of implementation) only when the class satisfies the following criteria:
    1) "Is a special kind of," not "is a role played by a";
    2) Never needs to transmute to be an object in some other class;
    3) Extends rather than overrides or nullifies superclass;
    4) Does not subclass what is merely a utility class (useful functionality you'd like to reuse); and
    5) Within PD: expresses special kinds of roles, transactions, or things.
    Why are you trying to force these mystery methodsfrom the superclass?
    It's not mandatory for me to do it... I 'd see it
    just like a further way to check that the subclasses
    implements these methods, as they have to do.That's not a good idea. If the superclass has no relation to the database, it shouldn't contain methods (abstract or otherwise) related to database transactions.
    The subclasses are the classes that handle db
    transaction.
    They are designed as a binding to a db table.And how is the superclass designed to handle db transactions? My guess (based on your description) is that it isn't. That should tell you right away that the subclasses should not extend your superclass.

Maybe you are looking for

  • Getting jbo-26080 from BC4J Tester

    I just created a master-detail relationship in Jdev 3.2 BC4J. I want to test the relationship in the Tester. I am able to insert one detail record for the master. When I am trying to insert the second detail record I am getting the following error me

  • Have a problem with updated Nokia maps

    i installed the lasted update of Nokia maps on my N86 8mp and now the gps icon doesn't disappear from the screen after i turn off the navigation and the direction voice doesn't work with the FM transmitter, i have tryed reset my phone and put everyth

  • Problem with hot corners with tracker pad

    scence upgrading lion my tracker pad will not drag or work on hot corners

  • Contact with AP but no internet?

    Subject say's it all.  I have made contact with the AP but not the internet?  any ideas?

  • Send attachment which can be opened in excel

    Hello I have an internal table, i want to send that through email (external) as an attachment the attachment should be such that it can be opened in excel file. (.xls or tab delimited .txt) I would be very thankful if someone can send me a sample cod