dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dotgnu-pnet-commits] CVS: pnetlib/runtime/System/Runtime/Remoting/Cont


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnetlib/runtime/System/Runtime/Remoting/Contexts Context.cs,NONE,1.1 ContextAttribute.cs,NONE,1.1 ContextProperty.cs,NONE,1.1 CrossContextDelegate.cs,NONE,1.1 IContextAttribute.cs,NONE,1.1 IContextProperty.cs,NONE,1.1 IContextPropertyActivator.cs,NONE,1.1 IContributeClientContextSink.cs,NONE,1.1 IContributeDynamicSink.cs,NONE,1.1 IContributeEnvoySink.cs,NONE,1.1 IContributeObjectSink.cs,NONE,1.1IContributeServerContextSink.cs,NONE,1.1 IDynamicMessageSink.cs,NONE,1.1 IDynamicProperty.cs,NONE,1.1 Makefile,NONE,1.1 SynchronizationAttribute.cs,NONE,1.1
Date: Thu, 17 Apr 2003 06:36:11 -0400

Update of /cvsroot/dotgnu-pnet/pnetlib/runtime/System/Runtime/Remoting/Contexts
In directory 
subversions:/tmp/cvs-serv31157/runtime/System/Runtime/Remoting/Contexts

Added Files:
        Context.cs ContextAttribute.cs ContextProperty.cs 
        CrossContextDelegate.cs IContextAttribute.cs 
        IContextProperty.cs IContextPropertyActivator.cs 
        IContributeClientContextSink.cs IContributeDynamicSink.cs 
        IContributeEnvoySink.cs IContributeObjectSink.cs 
        IContributeServerContextSink.cs IDynamicMessageSink.cs 
        IDynamicProperty.cs Makefile SynchronizationAttribute.cs 
Log Message:


Stub out a large number of classes under the "System.Runtime.Remoting"
namespace; add the "CONFIG_REMOTING" define to selection compilation of
remoting.


--- NEW FILE ---
/*
 * Context.cs - Implementation of the
 *                      "System.Runtime.Remoting.Contexts.Context" class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.Runtime.Remoting.Contexts
{

#if CONFIG_REMOTING

public class Context
{
        // Internal state.
        private int contextID;
        private IContextProperty[] properties;

        // Constructor.
        [TODO]
        public Context()
                        {
                                // TODO
                        }

        // Destructor.
        ~Context()
                        {
                                // TODO
                        }

        // Allocate a local data slot.
        [TODO]
        public static LocalDataStoreSlot AllocateDataSlot()
                        {
                                // TODO
                                return null;
                        }

        // Allocate a named local data slot.
        [TODO]
        public static LocalDataStoreSlot AllocNamedDataSlot(String name)
                        {
                                // TODO
                                return null;
                        }

        // Perform a cross-context callback.
        [TODO]
        public void DoCallBack(CrossContextDelegate deleg)
                        {
                                // TODO
                        }

        // Free a named local data slot.
        [TODO]
        public static void FreeNamedDataSlot(String name)
                        {
                                // TODO
                        }

        // Freeze this context.
        [TODO]
        public void Freeze()
                        {
                                // TODO
                        }

        // Get the data stored in a particular data store slot.
        [TODO]
        public static Object GetData(LocalDataStoreSlot slot)
                        {
                                // TODO
                                return null;
                        }

        // Get a named data store slot.
        [TODO]
        public static LocalDataStoreSlot GetNamedDataSlot(String name)
                        {
                                // TODO
                                return null;
                        }

        // Get a property from this context.
        [TODO]
        public IContextProperty GetProperty(String name)
                        {
                                // TODO
                                return null;
                        }

        // Register a dynamic property.
        [TODO]
        public static bool RegisterDynamicProperty
                                (IDynamicProperty prop, ContextBoundObject obj, 
Context ctx)
                        {
                                // TODO
                                return false;
                        }

        // Set the value of a local data store slot.
        [TODO]
        public static void SetData(LocalDataStoreSlot slot, Object value)
                        {
                                // TODO
                        }

        // Set a property on this context.
        [TODO]
        public void SetProperty(IContextProperty prop)
                        {
                                // TODO
                        }

        // Convert this object into a string.
        [TODO]
        public override String ToString()
                        {
                                // TODO
                                return null;
                        }

        // Unregister a dynamic property.
        [TODO]
        public static bool UnregisterDynamicProperty
                                (String name, ContextBoundObject obj, Context 
ctx)
                        {
                                // TODO
                                return false;
                        }

        // Get the identifier for this context.
        public int ContextID
                        {
                                get
                                {
                                        return contextID;
                                }
                        }

        // Get the properties on this context.
        public IContextProperty[] ContextProperties
                        {
                                get
                                {
                                        return properties;
                                }
                        }

        // Get the default context.
        [TODO]
        public static Context DefaultContext
                        {
                                get
                                {
                                        // TODO
                                        return null;
                                }
                        }

}; // class Context

#endif // CONFIG_REMOTING

}; // namespace System.Runtime.Remoting.Contexts

--- NEW FILE ---
/*
 * ContextAttribute.cs - Implementation of the
 *                      "System.Runtime.Remoting.Contexts.ContextAttribute" 
class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.Runtime.Remoting.Contexts
{

#if CONFIG_REMOTING

using System.Runtime.Remoting.Activation;

[Serializable]
[AttributeUsage(AttributeTargets.Class)]
public class ContextAttribute : Attribute, IContextAttribute, IContextProperty
{
        // Accessible state.
        protected String AttributeName;

        // Constructor.
        public ContextAttribute(String name)
                        {
                                this.AttributeName = name;
                        }

        // Get the name of this property.
        public virtual String Name
                        {
                                get
                                {
                                        return AttributeName;
                                }
                        }

        // Determine if two context attributes are equal.
        public override bool Equals(Object obj)
                        {
                                ContextAttribute other = (obj as 
ContextAttribute);
                                if(other != null)
                                {
                                        return (AttributeName == 
other.AttributeName);
                                }
                                else
                                {
                                        return false;
                                }
                        }

        // Freeze this property within a specific context.
        public virtual void Freeze(Context newContext)
                        {
                                // Nothing to do here.
                        }

        // Get a hash code for this object.
        public override int GetHashCode()
                        {
                                return AttributeName.GetHashCode();
                        }

        // Get the properties for a new construction context.
        public virtual void GetPropertiesForNewContext
                                (IConstructionCallMessage ctorMsg)
                        {
                                // TODO
                        }

        // Determine if a context is OK with respect to this attribute.
        public virtual bool IsContextOK
                                (Context ctx, IConstructionCallMessage msg)
                        {
                                // TODO
                                return false;
                        }

        // Determine if a new context is OK for this property.
        public virtual bool IsNewContextOK(Context newCtx)
                        {
                                // Nothing to do here except to say "yes".
                                return true;
                        }

}; // class ContextAttribute

#endif // CONFIG_REMOTING

}; // namespace System.Runtime.Remoting.Contexts

--- NEW FILE ---
/*
 * ContextProperty.cs - Implementation of the
 *                      "System.Runtime.Remoting.Contexts.ContextProperty" 
class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.Runtime.Remoting.Contexts
{

#if CONFIG_REMOTING

public class ContextProperty
{
        // Internal state.
        private String name;
        private Object value;

        // Constructor.
        internal ContextProperty(String name, Object value)
                        {
                                this.name = name;
                                this.value = value;
                        }

        // Get the name or value from this property.
        public String Name
                        {
                                get
                                {
                                        return name;
                                }
                        }
        public Object Value
                        {
                                get
                                {
                                        return value;
                                }
                        }

}; // class ContextProperty

#endif // CONFIG_REMOTING

}; // namespace System.Runtime.Remoting.Contexts

--- NEW FILE ---
/*
 * CrossContextDelegate.cs - Implementation of the
 *                      "System.Runtime.Remoting.Contexts.CrossContextDelegate" 
class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.Runtime.Remoting.Contexts
{

#if CONFIG_REMOTING

public delegate void CrossContextDelegate();

#endif // CONFIG_REMOTING

}; // namespace System.Runtime.Remoting.Contexts

--- NEW FILE ---
/*
 * IContextAttribute.cs - Implementation of the
 *                      "System.Runtime.Remoting.Contexts.IContextAttribute" 
class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.Runtime.Remoting.Contexts
{

#if CONFIG_REMOTING

using System.Runtime.Remoting.Activation;

public interface IContextAttribute
{
        // Get the properties for a new construction context.
        void GetPropertiesForNewContext(IConstructionCallMessage ctorMsg);

        // Determine if a context is OK with respect to this attribute.
        bool IsContextOK(Context ctx, IConstructionCallMessage msg);

}; // interface IContextAttribute

#endif // CONFIG_REMOTING

}; // namespace System.Runtime.Remoting.Contexts

--- NEW FILE ---
/*
 * IContextProperty.cs - Implementation of the
 *                      "System.Runtime.Remoting.Contexts.IContextProperty" 
class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.Runtime.Remoting.Contexts
{

#if CONFIG_REMOTING

public interface IContextProperty
{
        // Freeze this property within a specific context.
        void Freeze(Context newContext);

        // Determine if a new context is OK for this property.
        bool IsNewContextOK(Context newCtx);

        // Get the name of this property.
        String Name { get; }

}; // interface IContextProperty

#endif // CONFIG_REMOTING

}; // namespace System.Runtime.Remoting.Contexts

--- NEW FILE ---
/*
 * IContextPropertyActivator.cs - Implementation of the
 *                      
"System.Runtime.Remoting.Contexts.IContextPropertyActivator" class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.Runtime.Remoting.Contexts
{

#if CONFIG_REMOTING

using System.Runtime.Remoting.Activation;

public interface IContextPropertyActivator
{
        // Collect construction information from a client message.
        void CollectFromClientContext(IConstructionCallMessage msg);

        // Collection construction return information from a server message.
        void CollectFromServerContext(IConstructionReturnMessage msg);

        // Deliver client context information to the server.
        bool DeliverClientContextToServerContext(IConstructionCallMessage msg);

        // Deliver server context information to the client.
        bool DeliverServerContextToClientContext(IConstructionReturnMessage 
msg);

        // Determine if it is OK to activate a given call message.
        bool IsOKToActivate(IConstructionCallMessage msg);

}; // interface IContextPropertyActivator

#endif // CONFIG_REMOTING

}; // namespace System.Runtime.Remoting.Contexts

--- NEW FILE ---
/*
 * IContributeClientContextSink.cs - Implementation of the
 *              "System.Runtime.Remoting.Contexts.IContributeClientContextSink" 
class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.Runtime.Remoting.Contexts
{

#if CONFIG_REMOTING

using System.Runtime.Remoting.Messaging;

public interface IContributeClientContextSink
{
        // Get the client context sink.
        IMessageSink GetClientContextSink(IMessageSink nextSink);

}; // interface IContributeClientContextSink

#endif // CONFIG_REMOTING

}; // namespace System.Runtime.Remoting.Contexts

--- NEW FILE ---
/*
 * IContributeDynamicSink.cs - Implementation of the
 *              "System.Runtime.Remoting.Contexts.IContributeDynamicSink" class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.Runtime.Remoting.Contexts
{

#if CONFIG_REMOTING

public interface IContributeDynamicSink
{
        // Get the dynamic message sink.
        IDynamicMessageSink GetDynamicSink();

}; // interface IContributeDynamicSink

#endif // CONFIG_REMOTING

}; // namespace System.Runtime.Remoting.Contexts

--- NEW FILE ---
/*
 * IContributeEnvoySink.cs - Implementation of the
 *              "System.Runtime.Remoting.Contexts.IContributeEnvoySink" class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.Runtime.Remoting.Contexts
{

#if CONFIG_REMOTING

using System.Runtime.Remoting.Messaging;

public interface IContributeEnvoySink
{
        // Get the envoy sink.
        IMessageSink GetEnvoySink(MarshalByRefObject obj, IMessageSink 
nextSink);

}; // interface IContributeEnvoySink

#endif // CONFIG_REMOTING

}; // namespace System.Runtime.Remoting.Contexts

--- NEW FILE ---
/*
 * IContributeObjectSink.cs - Implementation of the
 *              "System.Runtime.Remoting.Contexts.IContributeObjectSink" class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.Runtime.Remoting.Contexts
{

#if CONFIG_REMOTING

using System.Runtime.Remoting.Messaging;

public interface IContributeObjectSink
{
        // Get the object sink.
        IMessageSink GetObjectSink(MarshalByRefObject obj, IMessageSink 
nextSink);

}; // interface IContributeObjectSink

#endif // CONFIG_REMOTING

}; // namespace System.Runtime.Remoting.Contexts

--- NEW FILE ---
/*
 * IContributeServerContextSink.cs - Implementation of the
 *              "System.Runtime.Remoting.Contexts.IContributeServerContextSink" 
class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.Runtime.Remoting.Contexts
{

#if CONFIG_REMOTING

using System.Runtime.Remoting.Messaging;

public interface IContributeServerContextSink
{
        // Get the server context sink.
        IMessageSink GetServerContextSink(IMessageSink nextSink);

}; // interface IContributeServerContextSink

#endif // CONFIG_REMOTING

}; // namespace System.Runtime.Remoting.Contexts

--- NEW FILE ---
/*
 * IDynamicMessageSink.cs - Implementation of the
 *                      "System.Runtime.Remoting.Contexts.IDynamicMessageSink" 
class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.Runtime.Remoting.Contexts
{

#if CONFIG_REMOTING

using System.Runtime.Remoting.Messaging;

public interface IDynamicMessageSink
{
        // Process a message finish operation.
        void ProcessMessageFinish(IMessage replyMsg, bool bCliSide, bool 
bAsync);

        // Process a message start operation.
        void ProcessMessageStart(IMessage reqMsg, bool bCliSide, bool bAsync);

}; // interface IDynamicMessageSink

#endif // CONFIG_REMOTING

}; // namespace System.Runtime.Remoting.Contexts

--- NEW FILE ---
/*
 * IDynamicProperty.cs - Implementation of the
 *                      "System.Runtime.Remoting.Contexts.IDynamicProperty" 
class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.Runtime.Remoting.Contexts
{

#if CONFIG_REMOTING

public interface IDynamicProperty
{
        // Get the property's name.
        String Name { get; }

}; // interface IDynamicProperty

#endif // CONFIG_REMOTING

}; // namespace System.Runtime.Remoting.Contexts

--- NEW FILE ---

# The build is done in "runtime", so cd up and use that Makefile.

all:
        (cd ../../../..;make)

--- NEW FILE ---
/*
 * SynchronizationAttribute.cs - Implementation of the
 *                      
"System.Runtime.Remoting.Contexts.SynchronizationAttribute" class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.Runtime.Remoting.Contexts
{

#if CONFIG_REMOTING

using System.Runtime.Remoting.Messaging;
using System.Runtime.Remoting.Activation;

[Serializable]
[AttributeUsage(AttributeTargets.Class)]
public class SynchronizationAttribute : ContextAttribute
{
        // Internal state.
        private int flag;
        private bool reEntrant;
        private bool locked;

        // Public flag values.
        public const int NOT_SUPPORTED  = 0x0001;
        public const int SUPPORTED              = 0x0002;
        public const int REQUIRED               = 0x0004;
        public const int REQUIRES_NEW   = 0x0008;

        // Constructors.
        public SynchronizationAttribute() : this(REQUIRED, false) {}
        public SynchronizationAttribute(bool reEntrant)
                        : this(REQUIRED, reEntrant) {}
        public SynchronizationAttribute(int flag) : this(flag, false) {}
        public SynchronizationAttribute(int flag, bool reEntrant)
                        : base("Synchronization")
                        {
                                if(flag != NOT_SUPPORTED && flag != SUPPORTED &&
                                   flag != REQUIRED && flag != REQUIRES_NEW)
                                {
                                        throw new ArgumentException
                                                (_("Arg_SynchronizationFlag"));
                                }
                                this.flag = flag;
                                this.reEntrant = reEntrant;
                        }

        // Determine if this attribute is re-entrant.
        public virtual bool IsReEntrant
                        {
                                get
                                {
                                        return reEntrant;
                                }
                        }

        // Get or set the context lock.
        public virtual bool Locked
                        {
                                get
                                {
                                        return locked;
                                }
                                set
                                {
                                        locked = value;
                                }
                        }

        // Create a client context sink and prepend it to a given chain.
        [TODO]
        public virtual IMessageSink GetClientContextSink(IMessageSink nextSink)
                        {
                                // TODO
                                return null;
                        }

        // Get the properties for a new construction context.
        [TODO]
        public override void GetPropertiesForNewContext
                                (IConstructionCallMessage ctorMsg)
                        {
                                // TODO
                        }

        // Determine if a context is OK with respect to this attribute.
        [TODO]
        public override bool IsContextOK
                                (Context ctx, IConstructionCallMessage msg)
                        {
                                // TODO
                                return false;
                        }

}; // class SynchronizationAttribute

#endif // CONFIG_REMOTING

}; // namespace System.Runtime.Remoting.Contexts





reply via email to

[Prev in Thread] Current Thread [Next in Thread]