Visibility of protected

Hi,
I was just thinking - why members marked with protected level visibility
allow other classes in the same package for accessing it ?
I would have thought that protected is strictly for inheritance purposes (doesn't
it work that way in C++ ??? )
Cheers,
Adrian

Hmmm,
I see what you mean. Perhaps I still can't get rid of C++ out of my mind :/
I must remember that the whole language has been designed on packages basis
and it's not just for namespace purposes .....
Is there any explanation on the web anyway ? I'd like to read some more info
about the design. I haven't seen any book dealing with java's design as there
are at least few on C++. Maybe I didn't look well ...
Thanks anyway !
Adrian

Similar Messages

  • Class Visibility of Protected Members between Packages

    Hi,
    I'm developing a system that consists of package A, which in turn contains packages B and C. My database access class is in a package by itself (package A.B) and I want anyone who uses it to provide a username and password. In order to do this, my system has a class called Config.java which resides in package A. When Config.java is instantiated, it will read the contents of some configuration xml file on the system and set protected variables for the username and password.
    My problem is the following:
    1. Config.java is not visible to any other classes in other packages unless it is public
    2. If Config.java is made public, then anyone can inherit from it and have access to its protected members.
    3. The other classes (in package A.C) must have access to the username and password in order to supply it to the database access class.
    How can I get around this?
    Thanks,
    Ama

    What is your concern, what someone will hack your
    database by deriving
    from Config?
    Is that a reasonable fear -- couldn't they just look
    in the XML file you mention?Well, hopefully that xml wont be so accessible, I'm thinking it will be necessary in case the user wants to modify any database settings through the application configuration screens.
    I guess what my question is really, is where would a large application that needs to access a database usually store the username and password information? Surely it cant be hardcoded in the application somewhere? What if the user wants to change the connection info?

  • Protected - an elementary question

    I can not really understand why the line:
    ProtectedConstructor o = new ProtectedConstructor(); // error
    is not correct.
    I am using eclipse and it suggest to change the visibility to protected but the visibility is protected:
    protected ProtectedConstructor() {}
    package aaa;
    public class ProtectedConstructor {
         protected ProtectedConstructor() {
    package bbb;
    import aaa.ProtectedConstructor;
    class MyProtectedConstructor extends ProtectedConstructor {
         ProtectedConstructor o = new ProtectedConstructor();
    $javac -version
    javac 1.7.0_17
    $javac aaa\ProtectedConstructor.java
    $javac bbb\TestConstructor.java
    bbb\TestConstructor.java:6: error: ProtectedConstructor() has protected access in ProtectedConstructor
    ProtectedConstructor o = new ProtectedConstructor();
    ^
    1 error
    Kind regards
    Mariusz
    Edited by: user4547842 on Apr 2, 2013 4:59 AM

    class MyProtectedConstructor extends ProtectedConstructor {
    $javac bbb\TestConstructor.javaThat's not the same class. Either you're not posting the actual code you're using, or you're confusing which code you actually want to compile. And please:
    a) use the New to Java forum when you're new to Java
    b) use \ tags when posting code                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Time Capsule appears twice in Airport drop down menu

    Menu Bar > Airport drop-down menu: My Time Capsule's wireless name shows up twice in my list of wifi sources. Once in the group with all the other routers and again in a group called "Devices".
    Long story short…
    I start with a perfectly functional, WPA/WPA2 password-protected Time Capsule: Over a year old. Two MbP's using it for Time Machine backup. Connected to a 1.5TB MyBook external HD via usb. Doubles as my wifi router. Everything's connected to it, including my wifi-enabled printer. Works great. No issues.
    I get this idea in my head that I need to hide my wifi signal. I figure it out and ¡Viola! Hidden. Then I try to add my wifi-enabled printer to the list of allowed devices in "Access Control". I hit a big snag and can't figure out how to get it to connect (btw, don't buy a Brother printer. Pure crap). So, I give up and revert permissions back to visible, password-protected state.
    Skipping irrelevant issues that I already resolved, I now have the wireless name of my Time Capsule appearing twice in the airport drop down menu. It appears with all the other wifi sources my machine detects AND appears at the bottom under a new category called "Devices".
    All I want is to have things back the way they were and this anomaly in the drop down menu is a constant reminder that I #1 failed and #2 bought a crap printer.
    (Long story long, I guess. Sorry.) How do I delete this "Devices" group from the airport drop down menu?

    Stilts McCoy wrote:
    Menu Bar > Airport drop-down menu: My Time Capsule's wireless name shows up twice in my list of wifi sources. Once in the group with all the other routers and again in a group called "Devices".
    You might find useful advice in this thread:
    http://discussions.apple.com/message.jspa?messageID=12156248
    If you want to post a reply, please do so to this thread, not the other one.

  • Help in XML encoders

    Here is the complete code of my problem.I�ve CADEntityImpl.java extending AtreeObject.java .CadPointImpl.java extending CADEntityImpl.java.CADPointImpl.java uses few constants of IEntitiesConstants.java and Main Program is ServerPartImpl.java. Here is the complete code.
    //////////////////////////////////////////////////////////////////////////////////CADEntity.java
    // Importing standard java packages/classes
    import java.awt.*;
    import java.rmi.*;
    import java.util.Vector;
    import javax.vecmath.AxisAngle4d;
    import java.rmi.server.*;
    import javax.vecmath.Point3d;
    import javax.vecmath.Vector3d;
    import java.util.StringTokenizer;
    // Importing standard xml packages/classes
    import org.xml.sax.SAXException;
    import org.xml.sax.*;
    import org.xml.sax.helpers.AttributesImpl;
    * Top level abstract Entity Class
    abstract public class CADEntityImpl extends ATreeObject implements java.io.Serializable,Entity{   
    //abstract public class CADEntityImpl extends ATreeObject implements java.io.Serializable{   
    /////////////////////////////////////////////////////////////////////// //INSTANCE VARIABLES
    private static final int currentVersion = 1;
    private int objectVersion = 1;
    /** Entity's base type (Eg: POINT, CURVE, SURFACE, SOLID etc..) */
    private int baseType;
    /** Entity's type (Eg: POINT, LINE, ARC, SOLID_BOX, B_SPLINE_SURFACE) */
    private int type;
    private int form = 0;
    private Color color = Color.magenta;
    private int style = 0;
    private String name = null;
    private int thickness = 1;
    private boolean visible = true;
    protected transient long casObj = 0;
    private long id = 0;
    // CONSTRUCTOR(S)
    public CADEntityImpl() throws RemoteException {
    public CADEntityImpl(int i) throws RemoteException{
    super(i);
    /** Get The entity id */
    public long getId() {
    return id;
    /** Get the entity name */
    public String getName() {
    return name;
    /** Get the entity form */
    public int getForm() {
    return form;
    /** Get the entity color */
    public Color getColor() {
    return color;
    /** Get the entity style */
    public int getStyle() {
    return style;
    /** Get the entity thickness */
    public int getThickness() {
    return thickness;
    /** Get the entity visibility */
    public boolean isVisible() {
    return visible;
    /** Get Cascade Obj ref */
    public long getCasObj() {
    return casObj;
    public int getObjectVersion()
    return objectVersion;
    public int getBaseType()
    return baseType;
    public int getType()
    return type;
    public void setBaseType(int m)
    this.baseType = m;
    public void setType(int m)
    this.type = m;
    // setter METHODS
    /** Set The entity id */
    public void setId(long id) {
    this.id = id;
    if (getName() == null) // If no name is assigned, give default name
    setName(IEntitiesConstants.EntityName[getType()] + id);
    /** Set the entity form */
    public void setForm(int form) {
    this.form = form;
    /** Set the entity name */
    public void setName(String name) {
    this.name = name;
    System.out.println("We have entered in name");
    System.out.println("Name : " + getName());
    /** Set the entity color */
    public void setColor(Color color) {
    this.color = color;
    System.out.println("We have entered in colour");
    System.out.println("color: " + getColor());
    /** Set the entity style */
    public void setStyle(int style) {
    this.style= style;
    /** Set the entity thickness */
    public void setThickness(int thickness) {
    this.thickness = thickness;
    /** Set the entity visibility */
    public void setVisible(boolean visible) {
    this.visible = visible;
    System.out.println("came in visible");
    public void setCasObj(long casPtr) {
    casObj = casPtr;
    public void setObjectVersion(int objectVersion) {
    this.objectVersion = objectVersion;
    // CLASS : ATreeObject - Associative Entity
    // Importing standard java packages/classes
    import java.rmi.*;
    import java.rmi.server.*;
    import java.util.Vector;
    import org.xml.sax.SAXException;
    import org.xml.sax.*;
    import org.xml.sax.helpers.AttributesImpl;
    * Top level abstract Entity Class
    abstract public class ATreeObject implements java.io.Serializable{
    // INSTANCE VARIABLES
    private int objectVersion = 1;
    private long id = 0;
    // CONSTRUCTOR(S)
    public ATreeObject() {
    public ATreeObject(int i) {
    // setter METHODS
    public void setObjectVersion(int ov)
    this.objectVersion = ov;
    // getter METHODS
    public int getObjectVersion()
    return objectVersion;
    // CLASS : CADPointImpl
    // Importing standard java packages/classes
    import javax.vecmath.*;
    import java.awt.*;
    import java.rmi.*;
    import java.util.Vector;
    import org.xml.sax.SAXException;
    import org.xml.sax.*;
    import org.xml.sax.helpers.AttributesImpl;
    * Create an CADPoint
    public class CADPointImpl extends CADEntityImpl implements Point
    //public class CADPointImpl extends CADEntityImpl
    private double x, y, z;
    private int pointSize=-1;
    private int objectVersion = 3;
    public CADPointImpl ()
    throws java.rmi.RemoteException {
    //setType(IEntitiesConstants.POINT);
    // setBaseType(IEntitiesConstants.POINT);
    public CADPointImpl(double xp, double yp, double zp)
    throws java.rmi.RemoteException {
    setType(IEntitiesConstants.POINT);
    setBaseType(IEntitiesConstants.POINT);
    setColor(new Color(1.00f, 1.00f, 0.00f));
    setObjectVersion(1);
    x = xp;
    y = yp;
    z = zp;
    // get and set methods for x,y and z
    public int getObjectVersion()
    return objectVersion;
    public void setObjectVersion(int ver)
    objectVersion = ver;
    public String toString(){
    return this.x+" "+this.y+" "+this.z;
    // CLASS : IEntitiesConstants
    // Importing standard java packages/classes
    public interface IEntitiesConstants
    public static final int POINT = 1;
    // Base Type of each of the Entities defined above. (Fill in
    // the base type in this array while new entities are added)
    public static final int BaseType[] = {DELETED,        //   0
                                              POINT,          //   1
    public static final String EntityName[] ={
    " ", // 0
    "pnt", // 1
    ServerPartImpl.java
    Main program where writeObject is being called
    // Importing standard java packages/classes
    import java.lang.*;
    import java.beans.*;
    import java.io.*;
    import java.sql.*;
    import javax.vecmath.*;
    import java.util.*;
    import java.util.Vector;
    import javax.media.j3d.*;
    import java.rmi.*;
    import java.awt.*;
    import java.lang.Boolean;
    import java.lang.Integer;
    import java.rmi.server.*;
    import javax.swing.*;
    import java.util.Date;
    import java.text.SimpleDateFormat;
    // Importing standard xml packages/classes
    import org.xml.sax.SAXException;
    import org.xml.sax.XMLReader;
    import org.xml.sax.*;
    import org.xml.sax.helpers.DefaultHandler;
    import org.xml.sax.Attributes;
    import org.xml.sax.helpers.AttributesImpl;
    import org.xml.sax.helpers.*;
    import javax.xml.parsers.*;
    // Importing incad java packages/classes
    * Top level abstract Header Class
    public class ServerPartImpl implements java.io.Serializable {
    // INSTANCE VARIABLES
    public static int ec = 0;
    // ENTITY GENERATOR METHODS
    public static void main(String args[])
    try {
    CADPointImpl newPoint = new CADPointImpl(20,60,34);
    addEntity(newPoint);
    try{
    XMLEncoder elc = new XMLEncoder(new BufferedOutputStream(new FileOutputStream("do.xml")));
    elc.writeObject(newPoint);
    elc.close();
    }catch(FileNotFoundException fn)
    } catch ( RemoteException re ) {
    // METHODS
    public static void addEntity(CADEntityImpl ent) {
    if(ec == 0)
    ec = 1;
    else
    ec++;
    ent.setId(ec);
    ent.setVisible(true);
    This is my complete code.Now,problem is that when I�m writing the CADPointImpl object only x,y,z,id and at times color is saved.Basetype,Type,visible,name,objectversion properties are not saved.Help me out����..please�.I�ve even tried to write the setfunction codes codes of basetype and type in CADPointImpl.java itself�..and from there calling super�..but even it didn�t helped out.

    Well Mr. Dheeraj - nice to know that you are still endevoring to gather knowledge. I guess that is required, especially as you come from a Computer Mechnaic background.
    Well then, allow me to give a few bits of wisdom (don't worry they are free). It would rather be greatly appreciated if you could stop embarrasing yourself in public by trying to catch my attention.
    If you require my assistance (which I am sure you would be), just write to me :> (I am sure that by now you must have got my mail address by heart). I must assure you that I never turn down pleas for help from commoners like yourself.
    However, I can sympathise with you on the count of the pang that you must be feeling while trying to graduate from a mechanic to a Master (which I am sure your limited capability is not permitting you).
    However, as is my duty, I always help commoners like you when I so deine to :>
    Your Lord
    Ironluca

  • Add and remove option in DataGrid in flex

    Dear Friends,
                    I have a datagrid which we can add a row and remove the row.In this DataGrid when i clicked to add new row im getting check Box at first,which i dont want to need at first.Pls help me regarding this.Please find the screen shot and code here.
    <fx:Script>
            <![CDATA[
    [Bindable]
                private var archiveData:ArrayCollection;
    private static const ADD_ARCH_ROW:String = "Click to Add Archive Row";
                private function checkArchiveEditBegin(e:DataGridEvent):void
                    if(e.rowIndex == archiveData.length - 1 && e.columnIndex != 1)                       
                        e.preventDefault();
                private function ediArchivetEnd(e:DataGridEvent):void
                     var item:Object = archiveGrid.dataProvider.getItemAt(e.rowIndex);           
                    if(e.rowIndex == archiveData.length - 1)
                        var txtIn:TextInput =     TextInput(e.currentTarget.itemEditorInstance);                   
                        var dt:Object = e.itemRenderer.data;                   
                        if(txtIn.text != ADD_ARCH_ROW)
                            archiveData.addItemAt(new archiveDetails(txtIn.text, "", ""), e.rowIndex);
                        archiveGrid.destroyItemEditor();                                   
                        e.preventDefault();
                public function deleteArchiveRow(e:MouseEvent):void{                           
                    archiveData.removeItemAt(archiveGrid.selectedIndex);
                    archiveData.refresh();               
                protected function AddArchiveRows(event:MouseEvent):void
                    archiveData = new ArrayCollection();                       
                    archiveData.addItem({archiveFrom: ADD_ARCH_ROW});               
                    archiveGrid.visible = true;               
                protected function button2_clickHandler(event:MouseEvent):void
                    if(archiveData.length!=1){
                    archiveData.removeItemAt(archiveGrid.selectedIndex);
    <mx:DataGrid id="archiveGrid" dataProvider="{myData}" x="399" y="6" width="539" height="169" visible="false" sortableColumns="false" editable="true"
                     itemEditBeginning="checkArchiveEditBegin(event)"
                     itemEditEnd="ediArchivetEnd(event)">
            <mx:columns>
                <mx:DataGridColumn id="arc" headerText="" width="50" editable="false">
                    <mx:itemRenderer>
                        <fx:Component>
                            <mx:CheckBox textAlign="center" click="outerDocument.deleteArchiveRow(event)"/>
                        </fx:Component>
                    </mx:itemRenderer>
                </mx:DataGridColumn>
                <mx:DataGridColumn headerText="FROM" dataField="archiveFrom" width="300"/>
                <mx:DataGridColumn headerText="TO" dataField="archiveTo" width="125"/>
                <mx:DataGridColumn headerText="DAYS" dataField="archiveDays" width="100"/>           
            </mx:columns>
        </mx:DataGrid>
    <s:Button x="444" y="266" label="Delete" click="button2_clickHandler(event)"/>

    Dear Frnds,
                    Please Help me to do the above bussiness.....

  • Calling Instance Method in a Global Class

    Hi All,
    Please can you tell me how to call a instance method created in a global class in different program.
    This is the code which I have written,
    data: g_cl type ref to <global class>.
    call method g_cl -> <method name>
    I am not able to create Create object <object>.
    It is throwing the error message " Instance class cannot be called outside...."
    Please can anybody help me..
    *Text deleted by moderator*
    Thanks
    Sushmitha

    Hi susmitha,
    1.
    data: g_cl type ref to <global class>.
    2.
    Create object <object>.
    3.
    call method g_cl -> <method name>.
    if still you are getting error.
    then first check that method level and visibility in se24.
    1.if  level is static you can not call it threw object.
    2. if visibility is protected or private then you can not  call it directly.
    If still you are facing same problem please paste the in this thread so that i can help you better.
    Regards.
    Punit
    Edited by: Punit Singh on Nov 3, 2008 11:54 AM

  • Different ways ofaccessing an object

    How many different ways you can access another class' methods and attributes. I mean other than just instantiating an object with in your class.
    Actually I read somewhere that an attrivute to an object can be made readily availabale to the entire application. How would u ever do that?

    One way would be the reflection api to access another classes methods. The only way to access attributes would be if the executing class was within the allowed visiblity (public, protected, package, private).

  • Inheritance in Java

    I have a little confusion regarding inheritance in Java... or perhaps the general concept... I was trying to write polymorphic code and I encountered this question...
    When a class inherits from another class, all the member variable is supposed to be inherited right? So, if I have something like:
    abstract class super{
    private SomeObject someObj;
    public abstract void foo();
    class sub extends super{
    public void foo(){
    someObj = new SomeObject();
    the class sub does not know about someObj. I tried different visibility for someObj but none worked...
    Something I have not tried, but might as well settle my question with inheritance here, is that if the super class were a concrete class, are all member variables inherited into its subclasses regardless of the member variables' visibility?
    Can someone clear my confusion? Thanx!

    I changed the visibility to protected and then public and it still would not compile... I think there might be something to do with the abstract.
    However, I remember that long time ago (I had this question for a while) I tested the concept with concrete classes and it seems that the private member variable is not inherited...
    That confused me quite a bit because I thought that when a parent class's member variable was private, a sub-class's object has no access to that variable of an instance of the parent class. But the subclass should have inherited it and should have its own copy of that variable. And when the visibility was protected, that's when an object of the subclass has access to that variable of an object of the parent class...
    I think the confusion comes from if visibility is meant for the class or for the instances of the class...

  • How to load webParts from external assemblies ?

    Hi
    i'm facing the problem when loading webParts from external assemblies. i've a lot of searched on internet, but nothing found! also i create a thread on
    asp.net forum, but nobody answer!
    does something wrong or is there any way to accomplish this ?
    thanks in advance
    http://www.codeproject.com/KB/codegen/DatabaseHelper.aspx

    Hi, Sure!
    here is my code :
    Aspx :
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
    <title></title>
    </head>
    <body>
    <form id="form1" runat="server">
    <asp:WebPartManager ID="WebPartManager1" runat="server">
    </asp:WebPartManager>
    <div>
    <asp:DropDownList ID="ddlDisplayMode" runat="server" AutoPostBack="True"
    onselectedindexchanged="ddlDisplayMode_SelectedIndexChanged">
    <asp:ListItem>Browse</asp:ListItem>
    <asp:ListItem>Design</asp:ListItem>
    </asp:DropDownList>
    <br />
    <div id="divWebPartBar" runat="server" visible="false">
    <asp:DropDownList ID="ddlWebParts" runat="server">
    </asp:DropDownList>
    <asp:DropDownList ID="ddlZones" runat="server">
    </asp:DropDownList>
    <asp:Button ID="btnLoadWebPart" runat="server"
    Text="Load WebPart to Selected Zone" onclick="btnLoadWebPart_Click" />
    </div>
    <div>
    <asp:WebPartZone ID="WebPartZone1" runat="server">
    <ZoneTemplate>
    <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
    </ZoneTemplate>
    </asp:WebPartZone>
    </div>
    <div>
    <asp:WebPartZone ID="WebPartZone2" runat="server">
    </asp:WebPartZone>
    </div>
    </div>
    </form>
    </body>
    </html>
    Default.aspx.cs :
    public partial class Default : System.Web.UI.Page
    const string _webPartsPath = "~/bin/CustomWebParts";
    private static Dictionary<string, Type> _dicWebparts;
    protected void Page_Load(object sender, EventArgs e)
    if (!Page.IsPostBack)
    _dicWebparts = LoadWebParts(_webPartsPath);
    foreach (string webPart in _dicWebparts.Keys)
    ListItem item = new ListItem(webPart);
    this.ddlWebParts.Items.Add(item);
    foreach (WebPartZone wpz in this.WebPartManager1.Zones)
    ListItem item = new ListItem(wpz.ID);
    this.ddlZones.Items.Add(item);
    //MyWebPart myWebPart = new MyWebPart();
    //this.WebPartManager1.AddWebPart(myWebPart, this.WebPartZone2, 0);
    protected void ddlDisplayMode_SelectedIndexChanged(object sender, EventArgs e)
    if (ddlDisplayMode.SelectedValue == "Browse")
    this.WebPartManager1.DisplayMode = WebPartManager.BrowseDisplayMode;
    this.divWebPartBar.Visible = false;
    else if (ddlDisplayMode.SelectedValue == "Design")
    this.WebPartManager1.DisplayMode = WebPartManager.DesignDisplayMode;
    this.divWebPartBar.Visible = true;
    protected void btnLoadWebPart_Click(object sender, EventArgs e)
    Type type = _dicWebparts[this.ddlWebParts.SelectedValue];
    WebPart webPart = (WebPart)Activator.CreateInstance(type, null);
    //this.WebPartManager1.AddWebPart(webPart, this.WebPartManager1.Zones[this.ddlZones.SelectedValue], 0);
    WebPartZone zone = (WebPartZone)this.WebPartManager1.Zones["WebPartZone2"];
    this.WebPartManager1.AddWebPart(webPart, zone, 0);
    private Dictionary<string, Type> LoadWebParts(string path)
    Dictionary<string, Type> dicResult = new Dictionary<string, Type>();
    string[] webPartsAssemblyPath = Directory.GetFiles(Server.MapPath(path), "*.dll", SearchOption.AllDirectories);
    if (webPartsAssemblyPath != null & webPartsAssemblyPath.Length > 0)
    foreach (string file in webPartsAssemblyPath)
    Assembly assembly = Assembly.LoadFile(file);
    Type[] types = null;
    try
    types = assembly.GetTypes();
    foreach (Type type in types)
    if (typeof(WebPart).IsAssignableFrom(type))
    //object obj = Activator.CreateInstance(type);
    //WebPart plugIn = (WebPart)obj;
    dicResult.Add(Path.GetFileNameWithoutExtension(file), type);
    catch (Exception ex)
    continue;
    return dicResult;
    My sample webpart in external assembly :
    namespace MyWebPart1
    public class MyWebPart1 : WebPart
    protected override void CreateChildControls()
    this.Controls.Clear();
    Label lbl = new Label();
    lbl.Text = "Hello web part 1";
    this.Controls.Add(lbl);
    this.ChildControlsCreated = true;
    thanks in advance
    http://www.codeproject.com/KB/codegen/DatabaseHelper.aspx

  • CRM IC Web - Inbound Plugs

    Hi,
    I have created a Custom view and attached the same within the Viewset 'BuPaIdentifyCustomer'. The Custom view is displayed as needed.
    I am trying to link 'BuPaSelectCustomer' and my Custom view. BuPaSelectCustomer displays all the customers in tabular format, and the first column is a button, on click of which method EH_ONSELECT is triggered.
    I have created a navigational link in BuPaNavigationalLinkGlobal.xml as follows:
                       <NavigationalLink name="intrec">
                        <Source viewRef="BuPaSelectCustomer" outboundPlugRef="default"/>
                        <Targets>
                             <Target viewRef="Z_CRM_IC/IntRecords" inboundPlugRef="INBOUNDPLUG"/>
                        </Targets>
                   </NavigationalLink>
    The Outbound plug method in the source view is triggered.
    I have created manually an inbound plug method 'IP_INBOUNDPLUG' in the target view controller class.  This method is not getting triggered.
    Can anyone please help me out in the same?
    Thanks,
    Shankar

    Hi All,
    The problem is solved. The inbound plug method's visibility was protected, it has now been set to Public and its working fine.
    Thanks,
    Shankar

  • How i add audio publisher/audio subscriber in my chat applcation

    hello,
    I try add audio publisher/audio subscriber  in chat applcation im using flash bulider 4 however i watch the example in smp applcations
    that have in sdk but what i need i include inside chat applcation button to start and stop audio in chat applcation i treid many times
    to do it but always give me error so what is the way to add audio publisher/audio subscriber  with button for user hit button run audio hit again stop audio, also need to add other button "logout" to user can logout from applaction when finish but after i add button is dosent work too.
    Need help
    Thanks

    Oh nigel sorry i really forget say what is th error however i gonna paste the code to see where is the error buttons "logout" and "start my audio" dosent work
    I dont know why here is the code,
    thanks nigel
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:s="library://ns.adobe.com/flex/spark"
                   xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="500" minHeight="500" xmlns:rtc="http://ns.adobe.com/rtc" width="590" height="590" backgroundColor="#3D3B3B" preloaderChromeColor="#999393">
        <fx:Style source="client.css"/>
        <fx:Script>
            <![CDATA[
                import mx.events.FlexEvent;
                protected function txtUsername_enterHandler(event:FlexEvent):void
                    // TODO Auto-generated method stub
                    connectRoom.login();
                    labelUsername.visible = false;
                    txtUsername.visible = false;
                protected function btnZoomScreen_clickHandler(event:MouseEvent):void
                    // move screenShare
                    if(btnZoomScreen.label == "zoom in"){
                        moveEffect.targets = [scrShare,labelScreen];
                        moveEffect.xTo = 10;
                        moveEffect.yTo = 10;
                        moveEffect.play();
                        resizeEffect.target = scrShare;
                        resizeEffect.widthTo = 520;
                        resizeEffect.heightTo = 479;
                        resizeEffect.play();
                        btnZoomScreen.label = "zoom out";
                        btnZoomScreen.y = 5;
                    }else{
                        moveEffect.targets = [scrShare,labelScreen];
                        moveEffect.xTo = 294;
                        moveEffect.yTo = 296;
                        moveEffect.play();
                        resizeEffect.target = scrShare;
                        resizeEffect.widthTo = 250;
                        resizeEffect.heightTo = 293;
                        resizeEffect.play();
                        btnZoomScreen.label = "zoom in";
                        btnZoomScreen.y = 296;
            ]]>
        </fx:Script>
        <fx:Declarations>
            <s:Move duration="500" id="moveEffect"/>
            <s:Resize duration="500" id="resizeEffect"/>
        </fx:Declarations>
        <rtc:ConnectSessionContainer horizontalScrollPolicy="off" verticalScrollPolicy="off" id="connectRoom" autoLogin="false"
                                     roomURL="http://connectnow.acrobat.com/jannaali/mymeeting"
                                     x="0" y="55" width="590" height="535" backgroundColor="#323131" contentBackgroundColor="#FFFFFF">
            <rtc:authenticator>
                <rtc:AdobeHSAuthenticator userName="{txtUsername.text}"/>
            </rtc:authenticator>
            <rtc:SimpleChat  x="10" y="10"  width="274" height="479" chromeColor="#CCCCCC"/>
            <rtc:WebcamSubscriber x="292" y="23" displayUserBars="true"  width="250" height="250"/>
            <rtc:AudioPublisher id="audioPub" height="0" />
            <rtc:AudioSubscriber id="audioSub" height="0" />
            <s:Label x="292" y="10" text="Ahmed's webcam" fontFamily="Verdana" fontSize="9" color="#040404" chromeColor="#CCCCCC"/>
            <rtc:ScreenShareSubscriber id="scrShare" width="250" height="193" x="294" y="296"/>       
            <s:Label id="labelScreen" x="295" y="285" text="Ahmed's screen" fontFamily="Verdana" fontSize="9" color="#060606"/>
            <mx:LinkButton x="474" y="296" label="zoom in" fontFamily="Verdana" color="#0712A9" id="btnZoomScreen" click="btnZoomScreen_clickHandler(event)"/>
            <s:Button x="19" y="497" label="start my audio" height="28" width="106"/>
            <s:Button x="133" y="497" label="logout" width="106" height="28"/>
        </rtc:ConnectSessionContainer>
        <s:Label id="labelUsername" x="165" y="191" text="Enter a username and press Enter:" color="#4A0606" fontSize="13" fontWeight="bold" fontStyle="italic"/>
        <s:TextInput x="165" y="205" width="221" textAlign="center" id="txtUsername" enter="txtUsername_enterHandler(event)"/>
    </s:Application>

  • Getting error on printing of crystal report

    hi..
    on clicking print button using active x i got this error why this error comes
    http://i51.tinypic.com/fz2bk0.png
    thanks in advance

    my cs file look like this
    using System;
    using System.Data;
    using System.Configuration;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;
    using CrystalDecisions.CrystalReports.Engine;
    using CrystalDecisions.Shared;
    public partial class _Default : System.Web.UI.Page
        ReportDocument crReportDocument = new ReportDocument();
        //'CrystalReport1' must be the name the CrystalReport
        TableLogOnInfo crTableLogOnInfo = new TableLogOnInfo();
        ConnectionInfo crConnectionInfo = new ConnectionInfo();
        //Crystal Report Properties
        CrystalDecisions.CrystalReports.Engine.Database crDatabase;
        CrystalDecisions.CrystalReports.Engine.Tables crTables;
        CrystalDecisions.CrystalReports.Engine.Table crTable;
        protected void ConfigureCrystalReports()
            string Server1 = ConfigurationManager.AppSettings["Server"];
            string user1 = ConfigurationManager.AppSettings["Userid"];
            string Password1 = ConfigurationManager.AppSettings["Password"];
            string DataBase1 = ConfigurationManager.AppSettings["DataBase"];
            crReportDocument.Load(Server.MapPath("InvoiceReport.rpt"));
            crConnectionInfo.ServerName = Server1;
            crConnectionInfo.DatabaseName = DataBase1;
            crConnectionInfo.IntegratedSecurity = false;
            crConnectionInfo.UserID = user1;
            crConnectionInfo.Password = Password1;
            crDatabase = crReportDocument.Database;
            crTables = crDatabase.Tables;
            foreach (CrystalDecisions.CrystalReports.Engine.Table crTable in crTables)
                crTableLogOnInfo = crTable.LogOnInfo;
                crTableLogOnInfo.ConnectionInfo = crConnectionInfo;
                crTable.ApplyLogOnInfo(crTableLogOnInfo);
            Session.Add("h1", crReportDocument);
        protected void Page_Init(object sender, EventArgs e)
            if (Session["h1"] == null)
                ConfigureCrystalReports();
            CrystalReportViewer1.ReportSource = Session["h1"];
            CrystalReportViewer1.RefreshReport();
            CrystalReportViewer1.Visible = true;
        protected void Page_Load(object sender, EventArgs e)
    is that i have to change anything...?

  • FYI: Error in contact tutorial using MS Access

    If you use MS Access for the tutorial "Using Adobe Dreamweaver Developer Toolbox to create a contact form," update the database so the primary key auto-increments. Otherwise the insert fails because the con_id field is required by the database. I gave feedback about the tutorial on 4/17/2008, but who knows if that will result in a changed database.

    Visibility                                           public     protected   default    private
    From the same class                                    yes          yes       yes         yes
    From any class in the same package                     yes          yes       yes         no
    From any class outside the package                     yes          no        no          no
    From any subclass in the same package                  yes          yes       yes         no
    From any subclass outside the package                  yes          yes       no          no

  • Object clone ?

    How does an Object clone code works ? Here is one example code I'm trying to understand.
    class Rabbit implements Cloneable
       public Object clone()
          try
             return super.clone();
          catch ( CloneNotSupportedException e )
             return null;
       } // end Rabbit
    Rabbit r1 = new Rabbit();
    Rabbit r2 = (Rabbit)r1.clone();Why there is to implement Cloneable interface in the above example? I think there is no need of implement Cloneable interface.
    Clone() method is available in Object class . We can override the clone() method as similar we do for toString() , equals method of Object class.

    jverd wrote:
    Not exactly: the example overrides clone only to extend its visibility (from protected to public) to be able to call it from outside the class. Here is another example that enables cloning without overriding the clone method:
    public class CloneableClassWhichDoesntImplementCloneMethod implements Cloneable {...}
    The problem with this, of course,...OK, I agree that the construct is a bit unusual and misleading.
    Again (again), my example was in the context of Jussi's sentence, which was not fully correct IMHO. I wouldn't recommend the approach I quoted.
    is that if I see that, and don't take the name literally, then I might expect this to work (...)And you'd be right :o)
    public class CloneableClassWhichDoesntImplementCloneMethod implements Cloneable {
        private int doomsday = 2001;
        public Object getClone() throws CloneNotSupportedException {
            return super.clone();
        public static class MyCloneable extends CloneableClassWhichDoesntImplementCloneMethod {
            private String subclassAttribute = "Nice try, Jeff";
            @Override
            public MyCloneable clone() throws CloneNotSupportedException {
                return (MyCloneable) super.clone();
        public static void main(String... args) {
            MyCloneable o2 = new MyCloneable();
            try {
                MyCloneable o4 = o2.clone();
                System.out.println("Field values have been cloned? "+(o2.subclassAttribute.equals(o4.subclassAttribute)));
            catch(CloneNotSupportedException cnse) {
                cnse.printStackTrace();
    Or if I notice that there's no public clone() method, despite implementing Cloneable, I'll be going, "WTF?"Well, you'd be right to complain against the bonehead-who-thought-it-clever-to-commit-artistic-code-before-switching-job-instead-of-following-well-known-idioms.
    EDIT (reworded stupid remark to look a little less stupid)
    But that's only an idiom, or even, a convention, stemming from Cloneable not declaring the method as public: if the JDK designers and the JLS had meant that implementing Cloneable implies having a public clone() method, they would have added it to the interface itself.

Maybe you are looking for

  • S.M.A.R.T. status message-what is this?

    S.M.A.R.T. status changed  messsage appeared on desktop. What does this mean?

  • My iPod nano turns off by itself

    i just got myself the iPod nano 6th generation and i kind of like it. I like the fact that it has the fitness part on it. But i don´t like that my iPod turns itself off when i try to count my steps! i turn it on in the morning so that i could count m

  • Download from app store

    had upgrade my ipad to ios6 but now face this problem - can't download a numbers of free apps from app store. it alway shows to answer their stupid securtiy question Repeatly and then no downloading done. its not user friendly anymore, messy. so how

  • Re : item category in BOm

    Hi     While creating BOM how to set Item category of the higher-level item like TAN TAQ. Thanks mani

  • Pages Sequence in Smartforms

    Hello Masters, I am new in SAP ABAP , i need your help , i am creating a Smartform for Appointment letter, there are 3 pages in the smartforms , each of the 3 pages has 3 main windows(main windows are empty) work has been done on other secondary wind